26
26
#include < boost/config.hpp>
27
27
#include < boost/range/begin.hpp>
28
28
#include < boost/range/end.hpp>
29
- #include < boost/mpl/identity .hpp> // for identity
30
- #include < boost/utility/enable_if.hpp> // for boost::disable_if
29
+ #include < boost/type_traits/type_identity .hpp> // for boost::type_identity
30
+ #include < boost/utility/enable_if.hpp> // for boost::disable_if
31
31
32
32
namespace boost { namespace algorithm {
33
33
34
34
// / \fn clamp ( T const& val,
35
- // / typename boost::mpl::identity <T>::type const & lo,
36
- // / typename boost::mpl::identity <T>::type const & hi, Pred p )
35
+ // / typename boost::type_identity <T>::type const & lo,
36
+ // / typename boost::type_identity <T>::type const & hi, Pred p )
37
37
// / \return the value "val" brought into the range [ lo, hi ]
38
38
// / using the comparison predicate p.
39
39
// / If p ( val, lo ) return lo.
@@ -48,17 +48,17 @@ namespace boost { namespace algorithm {
48
48
// /
49
49
template <typename T, typename Pred>
50
50
BOOST_CXX14_CONSTEXPR T const & clamp ( T const & val,
51
- typename boost::mpl::identity <T>::type const & lo,
52
- typename boost::mpl::identity <T>::type const & hi, Pred p )
51
+ typename boost::type_identity <T>::type const & lo,
52
+ typename boost::type_identity <T>::type const & hi, Pred p )
53
53
{
54
54
// assert ( !p ( hi, lo )); // Can't assert p ( lo, hi ) b/c they might be equal
55
55
return p ( val, lo ) ? lo : p ( hi, val ) ? hi : val;
56
56
}
57
57
58
58
59
59
// / \fn clamp ( T const& val,
60
- // / typename boost::mpl:: identity<T>::type const & lo,
61
- // / typename boost::mpl:: identity<T>::type const & hi )
60
+ // / typename boost::identity<T>::type const & lo,
61
+ // / typename boost::identity<T>::type const & hi )
62
62
// / \return the value "val" brought into the range [ lo, hi ].
63
63
// / If the value is less than lo, return lo.
64
64
// / If the value is greater than "hi", return hi.
@@ -70,8 +70,8 @@ namespace boost { namespace algorithm {
70
70
// /
71
71
template <typename T>
72
72
BOOST_CXX14_CONSTEXPR T const & clamp ( const T& val,
73
- typename boost::mpl::identity <T>::type const & lo,
74
- typename boost::mpl::identity <T>::type const & hi )
73
+ typename boost::type_identity <T>::type const & lo,
74
+ typename boost::type_identity <T>::type const & hi )
75
75
{
76
76
return boost::algorithm::clamp ( val, lo, hi, std::less<T>());
77
77
}
0 commit comments