Reference
Generates the macro metafunction name for BOOST_TTI_HAS_DATA. name = the name of the member data.returns = the generated macro metafunction name.
Generates the macro metafunction name for BOOST_TTI_HAS_FUNCTION. name = the name of the static member function.returns = the generated macro metafunction name.
Generates the macro metafunction name for BOOST_TTI_HAS_MEMBER_DATA. name = the name of the member data.returns = the generated macro metafunction name.
Generates the macro metafunction name for BOOST_TTI_HAS_MEMBER_FUNCTION. name = the name of the member function.returns = the generated macro metafunction name.
Generates the macro metafunction name for BOOST_TTI_HAS_STATIC_MEMBER_DATA. name = the name of the static member data.returns = the generated macro metafunction name.
Generates the macro metafunction name for BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION. name = the name of the static member function.returns = the generated macro metafunction name.
Generates the macro metafunction name for BOOST_TTI_HAS_TEMPLATE. name = the name of the class template.returns = the generated macro metafunction name.
Generates the macro metafunction name for BOOST_TTI_HAS_TYPE. name = the name of the type.returns = the generated macro metafunction name.
Generates the macro metafunction name for BOOST_TTI_MEMBER_TYPE. name = the name of the inner type.returns = the generated macro metafunction name.
Generates the name of the Boost TTI namespace. returns = the generated name of the Boost TTI namespace.
Expands to a metafunction which tests whether member data or static member with a particular name and type exists. trait = the name of the metafunction.name = the name of the inner member to introspect.generates a metafunction called "trait" where 'trait' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE> struct trait { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name' BOOST_TTI_TP_TYPE = The type of the member data or static member. returns = 'value' is true if the 'name' exists, with the correct data type, otherwise 'value' is false. Expands to a metafunction which tests whether member data or static member data with a particular name and type exists. name = the name of the inner member.generates a metafunction called "has_data_name" where 'name' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE> struct has_data_name { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name' BOOST_TTI_TP_TYPE = The type of the member data or static member. returns = 'value' is true if the 'name' exists, with the correct data type, otherwise 'value' is false.
Expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists. trait = the name of the metafunction within the tti namespace.name = the name of the inner member.generates a metafunction called "trait" where 'trait' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG> struct trait { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. BOOST_TTI_TP_R = the return type of the function BOOST_TTI_TP_FS = (optional) the parameters of the function as a boost::mpl forward sequence if function parameters are not empty. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function if the need for a tag exists. returns = 'value' is true if the 'name' exists, with the appropriate static member function type, otherwise 'value' is false. Expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists. name = the name of the inner member.generates a metafunction called "has_function_name" where 'name' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG> struct trait { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. BOOST_TTI_TP_R = the return type of the function BOOST_TTI_TP_FS = (optional) the parameters of the function as a boost::mpl forward sequence if function parameters are not empty. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function if the need for a tag exists. returns = 'value' is true if the 'name' exists, with the appropriate function type, otherwise 'value' is false.
Expands to a metafunction which tests whether a member data with a particular name and type exists. trait = the name of the metafunction.name = the name of the inner member to introspect.generates a metafunction called "trait" where 'trait' is the macro parameter. template<class BOOST_TTI_TP_ET,class BOOST_TTI_TP_TYPE> struct trait { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_ET = the enclosing type in which to look for our 'name' OR The type of the member data in the form of a pointer to member data. BOOST_TTI_TP_TYPE = (optional) The type of the member data if the first parameter is the enclosing type. returns = 'value' is true if the 'name' exists, with the correct data type, otherwise 'value' is false. Expands to a metafunction which tests whether a member data with a particular name and type exists. name = the name of the inner member.generates a metafunction called "has_member_data_name" where 'name' is the macro parameter. template<class BOOST_TTI_TP_ET,class BOOST_TTI_TP_TYPE> struct has_member_data_name { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_ET = the enclosing type in which to look for our 'name' OR The type of the member data in the form of a pointer to member data. BOOST_TTI_TP_TYPE = (optional) The type of the member data if the first parameter is the enclosing type. returns = 'value' is true if the 'name' exists, with the correct data type, otherwise 'value' is false.
Expands to a metafunction which tests whether a member function with a particular name and signature exists. trait = the name of the metafunction within the tti namespace.name = the name of the inner member.generates a metafunction called "trait" where 'trait' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG> struct trait { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name' OR a pointer to member function as a single type. BOOST_TTI_TP_R = (optional) the return type of the member function if the first parameter is the enclosing type. BOOST_TTI_TP_FS = (optional) the parameters of the member function as a boost::mpl forward sequence if the first parameter is the enclosing type and the member function parameters are not empty. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the member function if the first parameter is the enclosing type and a tag is needed. returns = 'value' is true if the 'name' exists, with the appropriate member function type, otherwise 'value' is false. Expands to a metafunction which tests whether a member function with a particular name and signature exists. name = the name of the inner member.generates a metafunction called "has_member_function_name" where 'name' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG> struct has_member_function_name { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name' OR a pointer to member function as a single type. BOOST_TTI_TP_R = (optional) the return type of the member function if the first parameter is the enclosing type. BOOST_TTI_TP_FS = (optional) the parameters of the member function as a boost::mpl forward sequence if the first parameter is the enclosing type and the member function parameters are not empty. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the member function if the first parameter is the enclosing type and a tag is needed. returns = 'value' is true if the 'name' exists, with the appropriate member function type, otherwise 'value' is false.
Expands to a metafunction which tests whether a static member data with a particular name and type exists. trait = the name of the metafunction within the tti namespace.name = the name of the inner member.generates a metafunction called "trait" where 'trait' is the macro parameter. The metafunction types and return: BOOST_TTI_TP_T = the enclosing type. BOOST_TTI_TP_TYPE = the static member data type, in the form of a data type, in which to look for our 'name'. returns = 'value' is true if the 'name' exists, with the BOOST_TTI_TP_TYPE type, within the enclosing BOOST_TTI_TP_T type, otherwise 'value' is false. Expands to a metafunction which tests whether a static member data with a particular name and type exists. name = the name of the inner member.generates a metafunction called "has_static_member_data_name" where 'name' is the macro parameter. The metafunction types and return: BOOST_TTI_TP_T = the enclosing type. BOOST_TTI_TP_TYPE = the static member data type, in the form of a data type, in which to look for our 'name'. returns = 'value' is true if the 'name' exists, with the appropriate BOOST_TTI_TP_TYPE type, within the enclosing BOOST_TTI_TP_T type, otherwise 'value' is false.
Expands to a metafunction which tests whether a static member function with a particular name and signature exists. trait = the name of the metafunction within the tti namespace.name = the name of the inner member.generates a metafunction called "trait" where 'trait' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG> struct trait { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. BOOST_TTI_TP_R = the return type of the static member function OR the signature of a function in the form of Return_Type ( Parameter_Types ) BOOST_TTI_TP_FS = (optional) the parameters of the static member function as a boost::mpl forward sequence if the second parameter is a return type and the function parameters exist. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function if the second parameter is a return type and the need for a tag exists. returns = 'value' is true if the 'name' exists, with the appropriate static member function type, otherwise 'value' is false. Expands to a metafunction which tests whether a static member function with a particular name and signature exists. name = the name of the inner member.generates a metafunction called "has_static_member_function_name" where 'name' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG> struct trait { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. BOOST_TTI_TP_R = the return type of the static member function OR the signature of a function in the form of Return_Type ( Parameter_Types ) BOOST_TTI_TP_FS = (optional) the parameters of the static member function as a boost::mpl forward sequence if the second parameter is a return type and the function parameters exist. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function if the second parameter is a return type and the need for a tag exists. returns = 'value' is true if the 'name' exists, with the appropriate static member function type, otherwise 'value' is false.
Expands to a metafunction which tests whether an inner class template with a particular name exists. trait = the name of the metafunction. ... = variadic parameters. The first variadic parameter is the inner class template name. Following variadic parameters are optional. If no following variadic parameters exist, then the inner class template being introspected must be all template type parameters ( template parameters starting with `class` or `typename` ) and any number of template type parameters can occur. If the second variadic parameter is BOOST_PP_NIL and no other variadic parameter is given, then just as in the previous case the inner class template being introspected must be all template type parameters ( template parameters starting with `class` or `typename` ) and any number of template type parameters can occur. This form is allowed in order to be consistent with using the non-variadic form of this macro. If the second variadic parameter is a Boost preprocessor library array and no other variadic parameter is given, then the inner class template must have its template parameters matching the sequence in the tuple portion of the Boost PP array. This form is allowed in order to be consistent with using the non-variadic form of this macro. Otherwise the inner class template must have its template parameters matching the sequence of the optional variadic parameters. generates a metafunction called "trait" where 'trait' is the first macro parameter. template<class BOOST_TTI_TP_T> struct trait { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. returns = 'value' is true if the 'name' template exists within the enclosing type, otherwise 'value' is false. Examples:1) Search for an inner class template called 'MyTemplate', with all template type parameters, nested within the class 'MyClass' using a metafunction name of 'MyMeta'.BOOST_TTI_TRAIT_HAS_TEMPLATE(MyMeta,MyTemplate)orBOOST_TTI_TRAIT_HAS_TEMPLATE(MyMeta,MyTemplate,BOOST_PP_NIL) // Non-variadic macro formMyMeta<MyClass>::valueis a compile time boolean constant which is either 'true' or 'false' if the nested template exists.2) Search for an inner class template called 'MyTemplate', with template parameters of 'class T,int x,template<class> class U', nested within the class 'MyClass' using a metafunction name of 'MyMeta'.BOOST_TTI_TRAIT_HAS_TEMPLATE(MyMeta,MyTemplate,class,int,template<class> class)orBOOST_TTI_TRAIT_HAS_TEMPLATE(MyMeta,MyTemplate,(3,(class,int,template<class> class))) // Non-variadic macro formMyMeta<MyClass>::valueis a compile time boolean constant which is either 'true' or 'false' if the nested template exists. Expands to a metafunction which tests whether an inner class template with a particular name exists. ... = variadic parameters. The first variadic parameter is the inner class template name. Following variadic parameters are optional. If no following variadic parameters exist, then the inner class template being introspected must be all template type parameters ( template parameters starting with `class` or `typename` ) and any number of template type parameters can occur. If the second variadic parameter is BOOST_PP_NIL and no other variadic parameter is given, then just as in the previous case the inner class template being introspected must be all template type parameters ( template parameters starting with `class` or `typename` ) and any number of template type parameters can occur. This form is allowed in order to be consistent with using the non-variadic form of this macro. If the second variadic parameter is a Boost preprocessor library array and no other variadic parameter is given, then the inner class template must have its template parameters matching the sequence in the tuple portion of the Boost PP array. This form is allowed in order to be consistent with using the non-variadic form of this macro. Otherwise the inner class template must have its template parameters matching the sequence of the optional variadic parameters. generates a metafunction called "has_template_'name'" where 'name' is the first variadic parameter. template<class BOOST_TTI_TP_T> struct has_template_'name' { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. returns = 'value' is true if the 'name' template exists within the enclosing type, otherwise 'value' is false. Examples:1) Search for an inner class template called 'MyTemplate', with all template type parameters, nested within the class 'MyClass'.BOOST_TTI_HAS_TEMPLATE(MyTemplate)orBOOST_TTI_HAS_TEMPLATE(MyTemplate,BOOST_PP_NIL) // Non-variadic macro formhas_template_MyTemplate<MyClass>::valueis a compile time boolean constant which is either 'true' or 'false' if the nested template exists.2) Search for an inner class template called 'MyTemplate' with template parameters of 'class T,int x,template<class> class U' nested within the class 'MyClass'.BOOST_TTI_HAS_TEMPLATE(MyTemplate,class,int,template<class> class)orBOOST_TTI_HAS_TEMPLATE(MyTemplate,(3,(class,int,template<class> class))) // Non-variadic macro formhas_template_MyTemplate<MyClass>::valueis a compile time boolean constant which is either 'true' or 'false' if the nested template exists.
BOOST_TTI_TRAIT_HAS_TYPE is a macro which expands to a metafunction. The metafunction tests whether an inner type with a particular name exists and, optionally, whether a lambda expression invoked with the inner type is true or not.trait = the name of the metafunction within the tti namespace.name = the name of the inner type.generates a metafunction called "trait" where 'trait' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U> struct trait { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type. If specified it is an MPL lambda expression which is invoked with the inner type found and must return a constant boolean value. returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified. If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' type exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false. If BOOST_TTI_TP_U is specified , then 'value' is true if the 'name' type exists within the enclosing type BOOST_TTI_TP_T and the lambda expression as specified by BOOST_TTI_TP_U, invoked by passing the actual inner type of 'name', returns a 'value' of true; otherwise 'value' is false. The action taken with BOOST_TTI_TP_U occurs only when the 'name' type exists within the enclosing type BOOST_TTI_TP_T. Example usage:BOOST_TTI_TRAIT_HAS_TYPE(LookFor,MyType) generates the metafunction LookFor in the current scope to look for an inner type called MyType.LookFor<EnclosingType>::value is true if MyType is an inner type of EnclosingType, otherwise false.LookFor<EnclosingType,ALambdaExpression>::value is true if MyType is an inner type of EnclosingType and invoking ALambdaExpression with the inner type returns a value of true, otherwise false.A popular use of the optional MPL lambda expression is to check whether the type found is the sameas another type, when the type found is a typedef. In that case our example would be:LookFor<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner type of EnclosingType and is the same type as SomeOtherType. BOOST_TTI_HAS_TYPE is a macro which expands to a metafunction. The metafunction tests whether an inner type with a particular name exists and, optionally, whether a lambda expression invoked with the inner type is true or not.name = the name of the inner type.generates a metafunction called "has_type_'name'" where 'name' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_U> struct has_type_'name' { static const value = unspecified; typedef mpl::bool_<true-or-false> type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'. BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type. If specified it is an MPL lambda expression which is invoked with the inner type found and must return a constant boolean value. returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified. If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' type exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false. If BOOST_TTI_TP_U is specified , then 'value' is true if the 'name' type exists within the enclosing type BOOST_TTI_TP_T and the lambda expression as specified by BOOST_TTI_TP_U, invoked by passing the actual inner type of 'name', returns a 'value' of true; otherwise 'value' is false. The action taken with BOOST_TTI_TP_U occurs only when the 'name' type exists within the enclosing type BOOST_TTI_TP_T. Example usage:BOOST_TTI_HAS_TYPE(MyType) generates the metafunction has_type_MyType in the current scope to look for an inner type called MyType.has_type_MyType<EnclosingType>::value is true if MyType is an inner type of EnclosingType, otherwise false.has_type_MyType<EnclosingType,ALambdaExpression>::value is true if MyType is an inner type of EnclosingType and invoking ALambdaExpression with the inner type returns a value of true, otherwise false.A popular use of the optional MPL lambda expression is to check whether the type found is the sameas another type, when the type found is a typedef. In that case our example would be:has_type_MyType<EnclosingType,boost::is_same<_,SomeOtherType> >::value is true if MyType is an inner type of EnclosingType and is the same type as SomeOtherType.
boost::mpl::not_< boost::is_same< TTI_METAFUNCTION::type, TTI_METAFUNCTION::boost_tti_marker_type > >A metafunction which checks whether the invoked macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ) hold a valid type. template<class TTI_METAFUNCTION> struct valid_member_metafunction { static const value = unspecified; typedef mpl::bool_<true-or-false> type; };The metafunction types and return:TTI_METAFUNCTION = The invoked macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ).returns = 'value' is true if the nested type of the invoked metafunction is valid, otherwise 'value' is false. A valid type means that the invoked metafunction's inner 'type' is not the marker type. boost::mpl::not_< boost::is_same< BOOST_TTI_TP_T, BOOST_TTI_TP_MARKER_TYPE > >A metafunction which checks whether the member 'type' returned from invoking the macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ) is a valid type. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = boost::tti::detail::notype> struct valid_member_type { static const value = unspecified; typedef mpl::bool_<true-or-false> type; };The metafunction types and return:BOOST_TTI_TP_T = returned inner 'type' from invoking the macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ). BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type. defaults to the internal boost::tti::detail::notype.returns = 'value' is true if the type is valid, otherwise 'value' is false. A valid type means that the returned inner 'type' is not the marker type. Expands to a metafunction whose typedef 'type' is either the named type or a marker type. trait = the name of the metafunction within the tti namespace.name = the name of the inner type.generates a metafunction called "trait" where 'trait' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = boost::tti::detail::notype> struct trait { typedef unspecified type; typedef BOOST_TTI_TP_MARKER_TYPE boost_tti_marker_type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type. BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type. defaults to the internal boost::tti::detail::notype. returns = 'type' is the inner type of 'name' if the inner type exists within the enclosing type, else 'type' is a marker type. if the end-user does not specify a marker type then an internal boost::tti::detail::notype marker type is used. The metafunction also encapsulates the type of the marker type as a nested 'boost_tti_marker_type'. The purpose of this macro is to encapsulate the 'name' type as the typedef 'type' of a metafunction, but only if it exists within the enclosing type. This allows for an evaluation of inner type existence, without generating a compiler error, which can be used by other metafunctions in this library. Expands to a metafunction whose typedef 'type' is either the named type or a marker type. name = the name of the inner type.generates a metafunction called "member_type_name" where 'name' is the macro parameter. template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = boost::tti::detail::notype> struct member_type_name { typedef unspecified type; typedef BOOST_TTI_TP_MARKER_TYPE boost_tti_marker_type; }; The metafunction types and return: BOOST_TTI_TP_T = the enclosing type. BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type. defaults to the internal boost::tti::detail::notype. returns = 'type' is the inner type of 'name' if the inner type exists within the enclosing type, else 'type' is a marker type. if the end-user does not specify a marker type then an internal boost::tti::detail::notype marker type is used. The metafunction also encapsulates the type of the marker type as a nested 'boost_tti_marker_type'. The purpose of this macro is to encapsulate the 'name' type as the typedef 'type' of a metafunction, but only if it exists within the enclosing type. This allows for an evaluation of inner type existence, without generating a compiler error, which can be used by other metafunctions in this library.