123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #ifndef BOOST_PROTO_TRANSFORM_INTEGRAL_C_HPP_EAN_04_28_2011
- #define BOOST_PROTO_TRANSFORM_INTEGRAL_C_HPP_EAN_04_28_2011
- #include <boost/proto/proto_fwd.hpp>
- #include <boost/proto/transform/impl.hpp>
- namespace boost { namespace proto
- {
-
-
-
- template<typename T, T I>
- struct integral_c : transform<integral_c<T, I> >
- {
- template<typename Expr, typename State, typename Data>
- struct impl : transform_impl<Expr, State, Data>
- {
- typedef T result_type;
-
-
- T operator()(
- typename impl::expr_param
- , typename impl::state_param
- , typename impl::data_param
- ) const
- {
- return I;
- }
- };
- };
-
-
-
- template<char I>
- struct char_
- : integral_c<char, I>
- {};
-
-
-
- template<int I>
- struct int_
- : integral_c<int, I>
- {};
-
-
-
- template<long I>
- struct long_
- : integral_c<long, I>
- {};
-
-
-
- template<std::size_t I>
- struct size_t
- : integral_c<std::size_t, I>
- {};
-
-
- template<typename T, T I>
- struct is_callable<integral_c<T, I> >
- : mpl::true_
- {};
-
-
- template<char I>
- struct is_callable<char_<I> >
- : mpl::true_
- {};
-
-
- template<int I>
- struct is_callable<int_<I> >
- : mpl::true_
- {};
-
-
- template<long I>
- struct is_callable<long_<I> >
- : mpl::true_
- {};
-
-
- template<std::size_t I>
- struct is_callable<size_t<I> >
- : mpl::true_
- {};
- }}
- #endif
|