File indexing completed on 2025-12-17 09:52:38
0001
0002 #ifndef BOOST_MPL_MATH_IS_EVEN_HPP_INCLUDED
0003 #define BOOST_MPL_MATH_IS_EVEN_HPP_INCLUDED
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <boost/mpl/bool.hpp>
0018 #include <boost/mpl/aux_/na_spec.hpp>
0019 #include <boost/mpl/aux_/lambda_support.hpp>
0020 #include <boost/mpl/aux_/config/msvc.hpp>
0021 #include <boost/mpl/aux_/config/workaround.hpp>
0022
0023 namespace boost { namespace mpl {
0024
0025 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
0026 namespace aux
0027 {
0028 template <class N>
0029 struct is_even_base
0030 {
0031 enum { value = (N::value % 2) == 0 };
0032 typedef bool_<value> type;
0033 };
0034 }
0035 #endif
0036
0037 template<
0038 typename BOOST_MPL_AUX_NA_PARAM(N)
0039 >
0040 struct is_even
0041 #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
0042 : aux::is_even_base<N>::type
0043 #else
0044 : bool_<((N::value % 2) == 0)>
0045 #endif
0046 {
0047 BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_even,(N))
0048 };
0049
0050 BOOST_MPL_AUX_NA_SPEC(1, is_even)
0051
0052 }}
0053
0054 #endif