File indexing completed on 2025-01-18 09:38:49
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_IOSTREAMS_DETAIL_BOOL_TRAIT_DEF_HPP_INCLUDED
0009 #define BOOST_IOSTREAMS_DETAIL_BOOL_TRAIT_DEF_HPP_INCLUDED
0010
0011 #include <boost/config.hpp> // BOOST_STATIC_CONSTANT.
0012 #include <boost/iostreams/detail/template_params.hpp>
0013 #include <boost/mpl/aux_/lambda_support.hpp>
0014 #include <boost/mpl/bool.hpp>
0015 #include <boost/preprocessor/cat.hpp>
0016 #include <boost/preprocessor/repetition/enum_params.hpp>
0017 #include <boost/type_traits/detail/yes_no_type.hpp>
0018
0019
0020
0021
0022
0023
0024 #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x582))
0025 # define BOOST_IOSTREAMS_TRAIT_NAMESPACE(trait)
0026 #else
0027 # define BOOST_IOSTREAMS_TRAIT_NAMESPACE(trait) BOOST_PP_CAT(trait, _impl_)::
0028 #endif
0029 #define BOOST_IOSTREAMS_BOOL_TRAIT_DEF(trait, type, arity) \
0030 namespace BOOST_PP_CAT(trait, _impl_) { \
0031 BOOST_IOSTREAMS_TEMPLATE_PARAMS(arity, T) \
0032 type_traits::yes_type helper \
0033 (const volatile type BOOST_IOSTREAMS_TEMPLATE_ARGS(arity, T)*); \
0034 type_traits::no_type helper(...); \
0035 template<typename T> \
0036 struct impl { \
0037 BOOST_STATIC_CONSTANT(bool, value = \
0038 (sizeof(BOOST_IOSTREAMS_TRAIT_NAMESPACE(trait) \
0039 helper(static_cast<T*>(0))) == \
0040 sizeof(type_traits::yes_type))); \
0041 }; \
0042 } \
0043 template<typename T> \
0044 struct trait \
0045 : mpl::bool_<BOOST_PP_CAT(trait, _impl_)::impl<T>::value> \
0046 { BOOST_MPL_AUX_LAMBDA_SUPPORT(1, trait, (T)) }; \
0047
0048
0049 #endif