File indexing completed on 2025-12-16 09:44:40
0001
0002
0003
0004 #ifndef BOOST_CONCEPT_REQUIRES_DWA2006430_HPP
0005 # define BOOST_CONCEPT_REQUIRES_DWA2006430_HPP
0006
0007 # include <boost/config.hpp>
0008 # include <boost/concept/assert.hpp>
0009 # include <boost/preprocessor/seq/for_each.hpp>
0010
0011 namespace boost {
0012
0013
0014
0015 namespace ccheck_aux {
0016
0017
0018 template <class UnaryFunctionPointer>
0019 struct unaryfunptr_arg_type;
0020
0021 template <class Arg>
0022 struct unaryfunptr_arg_type<void(*)(Arg)>
0023 {
0024 typedef Arg type;
0025 };
0026
0027 template <>
0028 struct unaryfunptr_arg_type<void(*)(void)>
0029 {
0030 typedef void type;
0031 };
0032
0033 }
0034
0035
0036 template <class Model, class More>
0037 struct requires_ : More
0038 {
0039 BOOST_CONCEPT_ASSERT((Model));
0040 };
0041
0042
0043
0044
0045 template <class ModelFn>
0046 struct _requires_
0047 {
0048 enum { value = 0 };
0049 BOOST_CONCEPT_ASSERT_FN(ModelFn);
0050 };
0051
0052 template <int check, class Result>
0053 struct Requires_ : ::boost::ccheck_aux::unaryfunptr_arg_type<Result>
0054 {
0055 };
0056
0057 # if BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(1010))
0058 # define BOOST_CONCEPT_REQUIRES_(r,data,t) | (::boost::_requires_<void(*)t>::value)
0059 # else
0060 # define BOOST_CONCEPT_REQUIRES_(r,data,t) + (::boost::_requires_<void(*)t>::value)
0061 # endif
0062
0063 #if defined(NDEBUG)
0064
0065 # define BOOST_CONCEPT_REQUIRES(models, result) \
0066 typename ::boost::ccheck_aux::unaryfunptr_arg_type<void(*)result>::type
0067
0068 #elif BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564))
0069
0070
0071 # define BOOST_CONCEPT_REQUIRES(models, result) \
0072 ::boost::Requires_< \
0073 (0 BOOST_PP_SEQ_FOR_EACH(BOOST_CONCEPT_REQUIRES_, ~, models)), \
0074 ::boost::ccheck_aux::unaryfunptr_arg_type<void(*)result> \
0075 >::type
0076
0077 #else
0078
0079
0080 # define BOOST_CONCEPT_REQUIRES(models, result) \
0081 typename ::boost::Requires_< \
0082 (0 BOOST_PP_SEQ_FOR_EACH(BOOST_CONCEPT_REQUIRES_, ~, models)), \
0083 void(*)result \
0084 >::type
0085
0086 #endif
0087
0088
0089 #define BOOST_CONCEPT_WHERE(models,result) BOOST_CONCEPT_REQUIRES(models,result)
0090
0091 }
0092
0093 #endif