1 #ifndef META_HS_META_HS_HPP 2 #define META_HS_META_HS_HPP 3 4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2012. 5 // Distributed under the Boost Software License, Version 1.0. 6 // (See accompanying file LICENSE_1_0.txt or copy at 7 // http://www.boost.org/LICENSE_1_0.txt) 8 9 #include <builder.hpp> 10 11 #include <boost/mpl/plus.hpp> 12 #include <boost/mpl/minus.hpp> 13 #include <boost/mpl/times.hpp> 14 #include <boost/mpl/divides.hpp> 15 #include <boost/mpl/less.hpp> 16 #include <boost/mpl/less_equal.hpp> 17 #include <boost/mpl/greater.hpp> 18 #include <boost/mpl/greater_equal.hpp> 19 #include <boost/mpl/equal_to.hpp> 20 #include <boost/mpl/not_equal_to.hpp> 21 22 #include <boost/preprocessor/cat.hpp> 23 #include <boost/preprocessor/seq/for_each.hpp> 24 25 #ifdef DEFINE_LAZY 26 #error DEFINE_LAZY already defined 27 #endif 28 #define DEFINE_LAZY(r, unused, name) \ 29 template <class A, class B> \ 30 struct BOOST_PP_CAT(lazy_, name) : \ 31 boost::mpl::name<typename A::type, typename B::type> \ 32 {}; 33 34 BOOST_PP_SEQ_FOR_EACH(DEFINE_LAZY, ~, 35 (plus) 36 (minus) 37 (times) 38 (divides) 39 (less) 40 (less_equal) 41 (greater) 42 (greater_equal) 43 (equal_to) 44 (not_equal_to) 45 ) 46 47 #undef DEFINE_LAZY 48 49 typedef builder<> 50 ::import2<boost::metaparse::string<'.','+','.'>, lazy_plus>::type 51 ::import2<boost::metaparse::string<'.','-','.'>, lazy_minus>::type 52 ::import2<boost::metaparse::string<'.','*','.'>, lazy_times>::type 53 ::import2<boost::metaparse::string<'.','/','.'>, lazy_divides>::type 54 ::import2<boost::metaparse::string<'.','<','.'>, lazy_less>::type 55 ::import2<boost::metaparse::string<'.','<','=','.'>, lazy_less_equal>::type 56 ::import2<boost::metaparse::string<'.','>','.'>, lazy_greater>::type 57 ::import2<boost::metaparse::string<'.','>','=','.'>, lazy_greater_equal>::type 58 ::import2<boost::metaparse::string<'.','=','=','.'>, lazy_equal_to>::type 59 ::import2<boost::metaparse::string<'.','/','=','.'>, lazy_not_equal_to>::type 60 61 meta_hs; 62 63 #endif 64 65