123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #ifndef BOOST_ALGORITHM_IS_CLAMPED_HPP
- #define BOOST_ALGORITHM_IS_CLAMPED_HPP
- #include <functional> // for std::less
- #include <cassert>
- #include <boost/type_traits/type_identity.hpp> // for boost::type_identity
- namespace boost { namespace algorithm {
- template <typename T, typename Pred>
- BOOST_CXX14_CONSTEXPR bool is_clamped(
- T const& val, typename boost::type_identity<T>::type const& lo,
- typename boost::type_identity<T>::type const& hi, Pred p) {
-
-
- return p(val, lo) ? false : p(hi, val) ? false : true;
- }
-
-
- template<typename T>
- BOOST_CXX14_CONSTEXPR bool is_clamped ( const T& val,
- typename boost::type_identity<T>::type const & lo,
- typename boost::type_identity<T>::type const & hi )
- {
- return boost::algorithm::is_clamped ( val, lo, hi, std::less<T>());
- }
- }}
- #endif
|