|
||||
File indexing completed on 2025-01-18 09:52:55
0001 0002 // (C) Copyright Edward Diener 2019 0003 // Use, modification and distribution are subject to the Boost Software License, 0004 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 0005 // http://www.boost.org/LICENSE_1_0.txt). 0006 0007 #if !defined(BOOST_TTI_STATIC_MEM_FUN_TEMPLATE_HPP) 0008 #define BOOST_TTI_STATIC_MEM_FUN_TEMPLATE_HPP 0009 0010 #include <boost/config.hpp> 0011 #include <boost/function_types/property_tags.hpp> 0012 #include <boost/mpl/vector.hpp> 0013 #include <boost/preprocessor/cat.hpp> 0014 #include <boost/tti/gen/namespace_gen.hpp> 0015 #include <boost/tti/gen/has_static_member_function_template_gen.hpp> 0016 #include <boost/tti/detail/dstatic_mem_fun_template.hpp> 0017 0018 #if BOOST_PP_VARIADICS 0019 0020 #include <boost/tti/detail/dmacro_fun_template.hpp> 0021 0022 /* 0023 0024 The succeeding comments in this file are in doxygen format. 0025 0026 */ 0027 0028 /** \file 0029 */ 0030 0031 /// A macro which expands to a metafunction which tests whether an inner static member function template with a particular name exists. 0032 /** 0033 0034 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction. 0035 The metafunction tests whether an inner static member function template with a particular name exists. 0036 The macro takes the form of BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,...) where 0037 0038 trait = the name of the metafunction <br/> 0039 name = inner static member function template name <br/> 0040 ... = variadic parameters. 0041 0042 The variadic parameter(s) are either: 0043 0044 A sequence of valid instantiations for the static member function template parameters 0045 ie. 'int,long,double' etc. 0046 0047 or 0048 0049 A single variadic parameter which is a Boost PP array whose elements are 0050 a sequence of valid instantiations for the static member function template parameters 0051 ie. '(3,(int,long,double))' etc. This form is allowed in order to be compatible 0052 with using the non-variadic form of this macro. 0053 0054 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter. 0055 0056 @code 0057 0058 template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG> 0059 struct trait 0060 { 0061 static const value = unspecified; 0062 typedef mpl::bool_<true-or-false> type; 0063 }; 0064 0065 The metafunction types and return: 0066 0067 BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. 0068 The enclosing type can be a class, struct, or union. 0069 0070 BOOST_TTI_TP_R = the return type of the static member function template 0071 in a single instantiation of the static member function template 0072 OR 0073 a pointer to function as a single type 0074 which encapsulates a single instantiation of 0075 the static member function template. 0076 0077 BOOST_TTI_TP_FS = (optional) the parameters of the static member function template as a boost::mpl forward sequence 0078 if the second parameter is the enclosing type and the static member function template parameters 0079 are not empty. These parameters are a single instantiation of the static member function template. 0080 0081 BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function template 0082 if the second parameter is the enclosing type and a tag is needed. 0083 0084 returns = 'value' is true if the 'name' exists, 0085 with the appropriate static member function template type, 0086 otherwise 'value' is false. 0087 0088 @endcode 0089 0090 */ 0091 #define BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,...) \ 0092 BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE \ 0093 ( \ 0094 trait, \ 0095 name, \ 0096 BOOST_TTI_DETAIL_FUN_TEMPLATE_VARIADIC_TO_ARRAY(__VA_ARGS__) \ 0097 ) \ 0098 template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS = boost::mpl::vector<>,class BOOST_TTI_TP_TAG = boost::function_types::null_tag> \ 0099 struct trait \ 0100 { \ 0101 typedef typename \ 0102 BOOST_PP_CAT(trait,_detail_hsmft)<BOOST_TTI_TP_T,BOOST_TTI_TP_R,BOOST_TTI_TP_FS,BOOST_TTI_TP_TAG>::type type; \ 0103 BOOST_STATIC_CONSTANT(bool,value=type::value); \ 0104 }; \ 0105 /**/ 0106 0107 0108 /// A macro which expands to a metafunction which tests whether an inner static member function template with a particular name exists. 0109 /** 0110 0111 BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction. 0112 The metafunction tests whether an inner static member function template with a particular name exists. 0113 The macro takes the form of BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(name,...) where 0114 0115 name = inner static member function template name <br/> 0116 ... = variadic parameters. 0117 0118 The variadic parameter(s) are either: 0119 0120 A sequence of valid instantiations for the static member function template parameters 0121 ie. 'int,long,double' etc. 0122 0123 or 0124 0125 A single variadic parameter which is a Boost PP array whose elements are 0126 a sequence of valid instantiations for the static member function template parameters 0127 ie. '(3,(int,long,double))' etc. This form is allowed in order to be compatible 0128 with using the non-variadic form of this macro. 0129 0130 BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "has_static_member_function_template_'name'" where 'name' is the first macro parameter. 0131 0132 @code 0133 0134 template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG> 0135 struct has_static_member_function_template_'name' 0136 { 0137 static const value = unspecified; 0138 typedef mpl::bool_<true-or-false> type; 0139 }; 0140 0141 The metafunction types and return: 0142 0143 BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. 0144 The enclosing type can be a class, struct, or union. 0145 0146 BOOST_TTI_TP_R = the return type of the static member function template 0147 in a single instantiation of the static member function template 0148 OR 0149 a pointer to function as a single type 0150 which encapsulates a single instantiation of 0151 the static member function template. 0152 0153 BOOST_TTI_TP_FS = (optional) the parameters of the static member function template as a boost::mpl forward sequence 0154 if the second parameter is the enclosing type and the static member function template parameters 0155 are not empty. These parameters are a single instantiation of the static member function template. 0156 0157 BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function template 0158 if the second parameter is the enclosing type and a tag is needed. 0159 0160 returns = 'value' is true if the 'name' exists, 0161 with the appropriate static member function template type, 0162 otherwise 'value' is false. 0163 0164 @endcode 0165 0166 */ 0167 #define BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(name,...) \ 0168 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE \ 0169 ( \ 0170 BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_GEN(name), \ 0171 name, \ 0172 __VA_ARGS__ \ 0173 ) \ 0174 /**/ 0175 0176 #else // !BOOST_PP_VARIADICS 0177 0178 /* 0179 0180 The succeeding comments in this file are in doxygen format. 0181 0182 */ 0183 0184 /** \file 0185 */ 0186 0187 /// A macro which expands to a metafunction which tests whether an inner static member function template with a particular name exists. 0188 /** 0189 0190 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction. 0191 The metafunction tests whether an inner static member function template with a particular name exists. 0192 The macro takes the form of BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) where 0193 0194 trait = the name of the metafunction <br/> 0195 name = inner static member function template name <br/> 0196 pparray = a Boost PP array whose elements are a sequence of valid instantiations for 0197 the static member function template parameters ie. '(3,(int,long,double))' etc. 0198 0199 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "trait" where 'trait' is the first macro parameter. 0200 0201 @code 0202 0203 template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG> 0204 struct trait 0205 { 0206 static const value = unspecified; 0207 typedef mpl::bool_<true-or-false> type; 0208 }; 0209 0210 The metafunction types and return: 0211 0212 BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. 0213 The enclosing type can be a class, struct, or union. 0214 0215 BOOST_TTI_TP_R = the return type of the static member function template 0216 in a single instantiation of the static member function template 0217 OR 0218 a pointer to function as a single type 0219 which encapsulates a single instantiation of 0220 the static member function template. 0221 0222 BOOST_TTI_TP_FS = (optional) the parameters of the static member function template as a boost::mpl forward sequence 0223 if the second parameter is the enclosing type and the static member function template parameters 0224 are not empty. These parameters are a single instantiation of the static member function template. 0225 0226 BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function template 0227 if the second parameter is the enclosing type and a tag is needed. 0228 0229 returns = 'value' is true if the 'name' exists, 0230 with the appropriate static member function template type, 0231 otherwise 'value' is false. 0232 0233 @endcode 0234 0235 */ 0236 #define BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \ 0237 BOOST_TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(trait,name,pparray) \ 0238 template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS = boost::mpl::vector<>,class BOOST_TTI_TP_TAG = boost::function_types::null_tag> \ 0239 struct trait \ 0240 { \ 0241 typedef typename \ 0242 BOOST_PP_CAT(trait,_detail_hsmft)<BOOST_TTI_TP_T,BOOST_TTI_TP_R,BOOST_TTI_TP_FS,BOOST_TTI_TP_TAG>::type type; \ 0243 BOOST_STATIC_CONSTANT(bool,value=type::value); \ 0244 }; \ 0245 /**/ 0246 0247 /// A macro which expands to a metafunction which tests whether an inner static member function template with a particular name exists. 0248 /** 0249 0250 BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE is a macro which expands to a metafunction. 0251 The metafunction tests whether an inner static member function template with a particular name exists. 0252 The macro takes the form of BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(name,pparray) where 0253 0254 name = inner static member function template name <br/> 0255 pparray = a Boost PP array whose elements are a sequence of valid instantiations for 0256 the static member function template parameters ie. '(3,(int,long,double))' etc. 0257 0258 BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE generates a metafunction called "has_static_member_function_template_'name'" where 'name' is the first macro parameter. 0259 0260 @code 0261 0262 template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG> 0263 struct has_static_member_function_template_'name' 0264 { 0265 static const value = unspecified; 0266 typedef mpl::bool_<true-or-false> type; 0267 }; 0268 0269 The metafunction types and return: 0270 0271 BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. 0272 The enclosing type can be a class, struct, or union. 0273 0274 BOOST_TTI_TP_R = the return type of the static member function template 0275 in a single instantiation of the static member function template 0276 OR 0277 a pointer to function as a single type 0278 which encapsulates a single instantiation of 0279 the static member function template. 0280 0281 BOOST_TTI_TP_FS = (optional) the parameters of the static member function template as a boost::mpl forward sequence 0282 if the second parameter is the enclosing type and the static member function template parameters 0283 are not empty. These parameters are a single instantiation of the static member function template. 0284 0285 BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function template 0286 if the second parameter is the enclosing type and a tag is needed. 0287 0288 returns = 'value' is true if the 'name' exists, 0289 with the appropriate static member function template type, 0290 otherwise 'value' is false. 0291 0292 @endcode 0293 0294 */ 0295 #define BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE(name,pparray) \ 0296 BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE \ 0297 ( \ 0298 BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_TEMPLATE_GEN(name), \ 0299 name, \ 0300 pparray \ 0301 ) \ 0302 /**/ 0303 0304 #endif // BOOST_PP_VARIADICS 0305 0306 #endif // BOOST_TTI_STATIC_MEM_FUN_TEMPLATE_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |