[#in_range] [section in_range] [h1 Synopsis] namespace util { template struct in_range; } This is a [link metafunction template metafunction] supporting [link currying currying]. [table Arguments [[Name] [Type]] [[`LowerBound`] [[link boxed_value boxed integral value]]] [[`UpperBound`] [[link boxed_value boxed integral value]]] [[`Item`] [[link boxed_value boxed integral value]]] ] [h1 Description] It returns a boxed boolean value. The value is `true` when `Item` is in the range `[LowerBound..UpperBound]` and `false` otherwise. `boost::mpl::less_equal` is used for comparison. [h1 Header] #include [h1 Expression semantics] For any `L`, `U` and `T` classes the following are equivalent: in_range::apply::type::value boost::mpl::less_equal::type::value && boost::mpl::less_equal::type::value [h1 Example] #include #include using namespace boost::metaparse; static_assert( !util::in_range< boost::mpl::int_<11>, boost::mpl::int_<13>, boost::mpl::int_<10> >::type::value, "A value below the lower bound should not be in the range" ); static_assert( !util::in_range< boost::mpl::int_<11>, boost::mpl::int_<13>, boost::mpl::int_<14> >::type::value, "A value above the upper bound should not be in the range" ); static_assert( util::in_range< boost::mpl::int_<11>, boost::mpl::int_<13>, boost::mpl::int_<11> >::type::value, "The lower bound should be in the range" ); static_assert( util::in_range< boost::mpl::int_<11>, boost::mpl::int_<13>, boost::mpl::int_<13> >::type::value, "The upper bound should be in the range" ); static_assert( util::in_range< boost::mpl::int_<11>, boost::mpl::int_<13>, boost::mpl::int_<12> >::type::value, "A value between the bounds should be in the range" ); static_assert( util::in_range<> ::apply>::type ::apply>::type ::apply>::type ::type::value, "It should support currying" ); [endsect]