Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:49

0001 #ifndef BOOST_METAPARSE_V1_UTIL_IN_RANGE_HPP
0002 #define BOOST_METAPARSE_V1_UTIL_IN_RANGE_HPP
0003 
0004 // Copyright Abel Sinkovics (abel@sinkovics.hu)  2009 - 2010.
0005 // Distributed under the Boost Software License, Version 1.0.
0006 //    (See accompanying file LICENSE_1_0.txt or copy at
0007 //          http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #include <boost/mpl/less_equal.hpp>
0010 #include <boost/mpl/comparison.hpp>
0011 #include <boost/mpl/quote.hpp>
0012 #include <boost/mpl/bool.hpp>
0013 
0014 #include <boost/mpl/vector.hpp>
0015 
0016 namespace boost
0017 {
0018   namespace metaparse
0019   {
0020     namespace v1
0021     {
0022       namespace util
0023       {
0024         template <
0025           class LowerBound = boost::mpl::na,
0026           class UpperBound = boost::mpl::na,
0027           class Item = boost::mpl::na
0028         >
0029         struct in_range :
0030           boost::mpl::bool_<
0031             boost::mpl::less_equal<LowerBound, Item>::type::value
0032             && boost::mpl::less_equal<Item, UpperBound>::type::value
0033           >
0034         {};
0035 
0036         template <class LowerBound, class UpperBound>
0037         struct in_range<LowerBound, UpperBound, boost::mpl::na>
0038         {
0039           typedef in_range type;
0040 
0041           template <class Item = boost::mpl::na>
0042           struct apply : in_range<LowerBound, UpperBound, Item> {};
0043         };
0044 
0045         template <class LowerBound>
0046         struct in_range<LowerBound, boost::mpl::na, boost::mpl::na>
0047         {
0048           typedef in_range type;
0049 
0050           template <
0051             class UpperBound = boost::mpl::na,
0052             class Item = boost::mpl::na
0053           >
0054           struct apply : in_range<LowerBound, UpperBound, Item> {};
0055         };
0056 
0057         template <>
0058         struct in_range<boost::mpl::na, boost::mpl::na, boost::mpl::na>
0059         {
0060           typedef in_range type;
0061 
0062           template <
0063             class LowerBound = boost::mpl::na,
0064             class UpperBound = boost::mpl::na,
0065             class Item = boost::mpl::na
0066           >
0067           struct apply : in_range<LowerBound, UpperBound, Item> {};
0068         };
0069       }
0070     }
0071   }
0072 }
0073 
0074 #endif
0075