|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68610 - in sandbox/tti: boost/tti boost/tti/detail libs/tti/doc libs/tti/test
From: eldiener_at_[hidden]
Date: 2011-02-01 20:44:21
Author: eldiener
Date: 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
New Revision: 68610
URL: http://svn.boost.org/trac/boost/changeset/68610
Log:
Changes to functionality for version 1.1
Added:
sandbox/tti/libs/tti/test/TestHasMemberData.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberData.hpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberDataCompile.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberDataFail.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberDataFail2.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberDataFail3.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberFunction.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberFunction.hpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberFunctionCompile.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberFunctionFail.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasMemberFunctionFail2.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasStaticMemberFunction.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasStaticMemberFunction.hpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasStaticMemberFunctionCompile.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasStaticMemberFunctionFail.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestHasStaticMemberFunctionFail2.cpp (contents, props changed)
Text files modified:
sandbox/tti/boost/tti/TTIntrospection.hpp | 298 ++++++++++++++++++++++++++++++---------
sandbox/tti/boost/tti/detail/TTIntrospectionDetail.hpp | 240 ++++++++++++++++++++++++++++++-
sandbox/tti/libs/tti/doc/Jamfile.v2 | 7
sandbox/tti/libs/tti/doc/TTIDetail.qbk | 93 ++++++++++--
sandbox/tti/libs/tti/doc/TTIFunctionality.qbk | 2
sandbox/tti/libs/tti/doc/TTIHistory.qbk | 13 +
sandbox/tti/libs/tti/doc/TTIIntroduction.qbk | 22 +-
sandbox/tti/libs/tti/doc/TTIMetafunctions.qbk | 74 ++++++---
sandbox/tti/libs/tti/doc/TTINestedType.qbk | 39 +++-
sandbox/tti/libs/tti/doc/TTIToDo.qbk | 1
sandbox/tti/libs/tti/doc/TTIUsingMM.qbk | 46 +++++
sandbox/tti/libs/tti/doc/TTIUsingNTM.qbk | 30 ++--
sandbox/tti/libs/tti/test/Jamfile.v2 | 13 +
sandbox/tti/libs/tti/test/TestMFHasMemberData.cpp | 10
sandbox/tti/libs/tti/test/TestMFHasMemberData.hpp | 16 +-
sandbox/tti/libs/tti/test/TestMFHasMemberDataCompile.cpp | 10
sandbox/tti/libs/tti/test/TestMFHasMemberDataFail.cpp | 2
sandbox/tti/libs/tti/test/TestMFHasMemberDataFail2.cpp | 2
sandbox/tti/libs/tti/test/TestMFHasMemberDataFail3.cpp | 2
sandbox/tti/libs/tti/test/TestMFHasMemberFunction.cpp | 21 +-
sandbox/tti/libs/tti/test/TestMFHasMemberFunction.hpp | 12
sandbox/tti/libs/tti/test/TestMFHasMemberFunctionCompile.cpp | 48 +++--
sandbox/tti/libs/tti/test/TestMFHasMemberFunctionFail.cpp | 11
sandbox/tti/libs/tti/test/TestMFHasMemberFunctionFail3.cpp | 11
sandbox/tti/libs/tti/test/TestMFHasStaticFunction.cpp | 29 ++-
sandbox/tti/libs/tti/test/TestMFHasStaticFunction.hpp | 8
sandbox/tti/libs/tti/test/TestMFHasStaticFunctionCompile.cpp | 42 +++--
sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail.cpp | 9
sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail2.cpp | 9
sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail3.cpp | 11
30 files changed, 860 insertions(+), 271 deletions(-)
Modified: sandbox/tti/boost/tti/TTIntrospection.hpp
==============================================================================
--- sandbox/tti/boost/tti/TTIntrospection.hpp (original)
+++ sandbox/tti/boost/tti/TTIntrospection.hpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -4,6 +4,7 @@
#include <boost/config.hpp>
#include <boost/function_types/is_member_object_pointer.hpp>
#include <boost/function_types/parameter_types.hpp>
+#include <boost/function_types/property_tags.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/bool.hpp>
@@ -11,10 +12,9 @@
#include <boost/mpl/identity.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/quote.hpp>
+#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/type_traits/detail/yes_no_type.hpp>
@@ -732,7 +732,7 @@
\
BOOST_STATIC_CONSTANT(bool,value=sizeof(check<typename class_type<T>::type>(0))==sizeof(::boost::type_traits::yes_type)); \
\
- typedef trait type; \
+ typedef boost::mpl::bool_<value> type; \
}; \
} \
/**/
@@ -745,7 +745,7 @@
trait = the name of the metafunction within the tti namespace.<br />
name = the name of the inner member.
- returns = a metafunction called "tti::trait" where 'trait' is the macro parameter.<br />
+ returns = a metafunction called "tti::trait" where 'trait' is the macro parameter.
The metafunction types and return:
@@ -811,7 +811,7 @@
\
BOOST_STATIC_CONSTANT(bool,value=sizeof(check<typename class_type<T>::type>(nullptr))==sizeof(::boost::type_traits::yes_type)); \
\
- typedef trait type; \
+ typedef boost::mpl::bool_<value> type; \
}; \
} \
/**/
@@ -843,6 +843,122 @@
) \
/**/
+/// 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.<br />
+ name = the name of the inner member.
+
+ returns = a metafunction called "tti::trait" where 'trait' is the macro parameter.<br />
+
+ The metafunction types and return:
+
+ T = the enclosing type in which to look for our 'name'.<br />
+ R = the return type of the member function.<br />
+ FS = an optional parameter which are the parameters of the member function as a boost::mpl forward sequence.<br />
+ TAG = an optional parameter which is a boost::function_types tag to apply to the member function.<br />
+ returns = 'value' is true if the 'name' exists, with the appropriate type,
+ otherwise 'value' is false.
+
+*/
+#define TTI_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \
+namespace tti \
+ { \
+ namespace detail \
+ { \
+ TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \
+ } \
+ template<class T,class R,class FS = boost::mpl::vector<>,class TAG = boost::function_types::null_tag> \
+ struct trait \
+ { \
+ typedef detail::trait<typename detail::ptmf_seq<T,R,FS,TAG>::type,typename boost::remove_const<T>::type> type; \
+ \
+ BOOST_STATIC_CONSTANT(bool,value=type::value); \
+ }; \
+ } \
+/**/
+
+/// Expands to a metafunction which tests whether a member function with a particular name and signature exists.
+/**
+
+ name = the name of the inner member.
+
+ returns = a metafunction called "tti::has_member_function_name" where 'name' is the macro parameter.
+
+ The metafunction types and return:
+
+ T = the enclosing type in which to look for our 'name'.<br />
+ R = the return type of the member function.<br />
+ FS = an optional parameter which are the parameters of the member function as a boost::mpl forward sequence.<br />
+ TAG = an optional parameter which is a boost::function_types tag to apply to the member function.<br />
+ returns = 'value' is true if the 'name' exists, with the appropriate type,
+ otherwise 'value' is false.
+
+*/
+#define TTI_HAS_MEMBER_FUNCTION(name) \
+ TTI_TRAIT_HAS_MEMBER_FUNCTION \
+ ( \
+ BOOST_PP_CAT(has_member_function_,name), \
+ name \
+ ) \
+/**/
+
+/// Expands to a metafunction which tests whether a member data with a particular name and type exists.
+/**
+
+ trait = the name of the metafunction within the tti namespace.<br />
+ name = the name of the inner member.
+
+ returns = a metafunction called "tti::trait" where 'trait' is the macro parameter.<br />
+
+ The metafunction types and return:
+
+ T = the enclosing type in which to look for our 'name'.<br />
+ R = the type of the member data.<br />
+ returns = 'value' is true if the 'name' exists, with the appropriate type,
+ otherwise 'value' is false.
+
+*/
+#define TTI_TRAIT_HAS_MEMBER_DATA(trait,name) \
+namespace tti \
+ { \
+ namespace detail \
+ { \
+ TTI_DETAIL_TRAIT_HAS_MEMBER_DATA(trait,name) \
+ } \
+ template<class T,class R> \
+ struct trait \
+ { \
+ typedef detail::trait<typename detail::ptmd<T,R>::type,typename boost::remove_const<T>::type> type; \
+ \
+ BOOST_STATIC_CONSTANT(bool,value=type::value); \
+ }; \
+ } \
+/**/
+
+/// Expands to a metafunction which tests whether a member data with a particular name and type exists.
+/**
+
+ name = the name of the inner member.
+
+ returns = a metafunction called "tti::has_member_data_name" where 'name' is the macro parameter.
+
+ The metafunction types and return:
+
+ T = the enclosing type in which to look for our 'name'.<br />
+ R = the type of the member data.<br />
+ returns = 'value' is true if the 'name' exists, with the appropriate type,
+ otherwise 'value' is false.
+
+*/
+#define TTI_HAS_MEMBER_DATA(name) \
+ TTI_TRAIT_HAS_MEMBER_DATA \
+ ( \
+ BOOST_PP_CAT(has_member_data_,name), \
+ name \
+ ) \
+/**/
+
#if defined(BOOST_NO_NULLPTR)
/// Expands to a metafunction which tests whether a static member data or a static member function with a particular name and type exists.
@@ -881,7 +997,7 @@
\
BOOST_STATIC_CONSTANT(bool,value=sizeof(check<T>(0))==sizeof(::boost::type_traits::yes_type)); \
\
- typedef trait type; \
+ typedef boost::mpl::bool_<value> type; \
}; \
} \
/**/
@@ -924,7 +1040,7 @@
\
BOOST_STATIC_CONSTANT(bool,value=sizeof(check<T>(nullptr))==sizeof(::boost::type_traits::yes_type)); \
\
- typedef trait type; \
+ typedef boost::mpl::bool_<value> type; \
}; \
} \
/**/
@@ -957,6 +1073,66 @@
) \
/**/
+/// 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.<br />
+ name = the name of the inner member.
+
+ returns = a metafunction called "tti::trait" where 'trait' is the macro parameter.<br />
+
+ The metafunction types and return:
+
+ T = the enclosing type in which to look for our 'name'.<br />
+ R = the return type of the static member function.<br />
+ FS = an optional parameter which are the parameters of the static member function as a boost::mpl forward sequence.<br />
+ TAG = an optional parameter which is a boost::function_types tag to apply to the static member function.<br />
+ returns = 'value' is true if the 'name' exists, with the appropriate type,
+ otherwise 'value' is false.
+
+*/
+#define TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
+namespace tti \
+ { \
+ namespace detail \
+ { \
+ TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
+ } \
+ template<class T,class R,class FS = boost::mpl::vector<>,class TAG = boost::function_types::null_tag> \
+ struct trait \
+ { \
+ typedef detail::trait<T,typename detail::tfunction_seq<R,FS,TAG>::type> type; \
+ \
+ BOOST_STATIC_CONSTANT(bool,value=type::value); \
+ }; \
+ } \
+/**/
+
+/// 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.
+
+ returns = a metafunction called "tti::has_static_member_function_name" where 'name' is the macro parameter.
+
+ The metafunction types and return:
+
+ T = the enclosing type in which to look for our 'name'.<br />
+ R = the return type of the static member function.<br />
+ FS = an optional parameter which are the parameters of the static member function as a boost::mpl forward sequence.<br />
+ TAG = an optional parameter which is a boost::function_types tag to apply to the static member function.<br />
+ returns = 'value' is true if the 'name' exists, with the appropriate type,
+ otherwise 'value' is false.
+
+*/
+#define TTI_HAS_STATIC_MEMBER_FUNCTION(name) \
+ TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION \
+ ( \
+ BOOST_PP_CAT(has_static_member_function_,name), \
+ name \
+ ) \
+/**/
+
namespace tti
{
@@ -967,8 +1143,8 @@
The metafunction types and return:
- HasType = Template class generated from the TTI_HAS_TYPE ( or TTI_TRAIT_HAS_TYPE ) macro.<br />
- T = The enclosing type as a nullary metafunction.
+ HasType = template class generated from the TTI_HAS_TYPE ( or TTI_TRAIT_HAS_TYPE ) macro.<br />
+ T = the enclosing type as a nullary metafunction.
U = the type of the inner type as a nullary metafunction, as an optional parameter.<br />
returns = 'value' is true if the type exists within the enclosing type
@@ -1001,8 +1177,8 @@
The metafunction types and return:
- MemberType = Template class generated from the TTI_MEMBER_TYPE ( or TTI_TRAIT_MEMBER_TYPE ) macro.<br />
- T = The enclosing type as a nullary metafunction.
+ MemberType = template class generated from the TTI_MEMBER_TYPE ( or TTI_TRAIT_MEMBER_TYPE ) macro.<br />
+ T = the enclosing type as a nullary metafunction.
returns = 'type' is the inner type of the 'name' in TTI_MEMBER_TYPE ( or TTI_TRAIT_MEMBER_TYPE )
if the inner type exists within the enclosing type,
@@ -1044,8 +1220,8 @@
The metafunction types and return:
- HasTemplate = Template class generated from TTI_HAS_TEMPLATE ( TTI_TRAIT_HAS_TEMPLATE )<br />
- T = The enclosing type as a nullary metafunction.
+ HasTemplate = template class generated from TTI_HAS_TEMPLATE ( TTI_TRAIT_HAS_TEMPLATE )<br />
+ T = the enclosing type as a nullary metafunction.
returns = 'value' is true if the template exists within the enclosing type,
otherwise 'value' is false.
@@ -1070,15 +1246,15 @@
/// A metafunction which checks whether a member function exists within an enclosing type.
/**
- This metafunction takes all its types as nullary metafunctions whose typedef 'type' member is the actual type used.
+ This metafunction takes all its types, except for the optional parameters, as nullary metafunctions whose typedef 'type' member is the actual type used.
The metafunction types and return:
- HasMember = Template class generated from the TTI_HAS_MEMBER ( or TTI_TRAIT_HAS_MEMBER ) macro.<br />
- T = The enclosing type as a nullary metafunction.<br />
- R = The return type of the member function as a nullary metafunction.<br />
- P... = The parameter types of the member function, each as a nullary metafunction.<br />
- There can be up to TTI_MAX_PARAMETERS number of parameters. The default is 10.
+ HasMemberFunction = template class generated from the TTI_HAS_MEMBER_FUNCTION ( or TTI_TRAIT_HAS_MEMBER_FUNCTION ) macro.<br />
+ T = the enclosing type as a nullary metafunction.<br />
+ R = the return type of the member function as a nullary metafunction.<br />
+ FS = an optional parameter which are the parameters of the member function, each as a nullary metafunction, as a boost::mpl forward sequence.<br />
+ TAG = an optional parameter which is a boost::function_types tag to apply to the member function.
returns = 'value' is true if the member function exists within the enclosing type,
otherwise 'value' is false.
@@ -1086,25 +1262,21 @@
*/
template
<
- template<class> class HasMember,
+ template<class,class,class,class> class HasMemberFunction,
class T,
class R,
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(TTI_MAX_PARAMETERS,class P,tti::detail::noparam)
+ class FS = boost::mpl::vector<>,
+ class TAG = boost::function_types::null_tag
>
struct mf_has_member_function :
- tti::detail::eval
+ tti::detail::mf_eval_function
<
- HasMember
+ HasMemberFunction
<
- tti::detail::eval
- <
- tti::detail::ptmf
- <
- T,
- R,
- BOOST_PP_ENUM_PARAMS(TTI_MAX_PARAMETERS,P)
- >
- >
+ T,
+ R,
+ FS,
+ TAG
>
>
{
@@ -1117,9 +1289,9 @@
The metafunction types and return:
- HasMember = Template class generated from the TTI_HAS_MEMBER ( or TTI_TRAIT_HAS_MEMBER ) macro.<br />
- T = The enclosing type as a nullary metafunction.<br />
- R = The type of the member data as a nullary metafunction.
+ HasMemberData = template class generated from the TTI_HAS_MEMBER_DATA ( or TTI_TRAIT_HAS_MEMBER_DATA ) macro.<br />
+ T = the enclosing type as a nullary metafunction.<br />
+ R = the type of the member data as a nullary metafunction.
returns = 'value' is true if the member data exists within the enclosing type,
otherwise 'value' is false.
@@ -1127,23 +1299,17 @@
*/
template
<
- template<class> class HasMember,
+ template<class,class> class HasMemberData,
class T,
class R
>
struct mf_has_member_data :
tti::detail::eval
<
- HasMember
+ HasMemberData
<
- tti::detail::eval
- <
- tti::detail::ptmd
- <
- T,
- R
- >
- >
+ T,
+ R
>
>
{
@@ -1152,41 +1318,37 @@
/// A metafunction which checks whether a static member function exists within an enclosing type.
/**
- This metafunction takes all its types as nullary metafunctions whose typedef 'type' member is the actual type used.
+ This metafunction takes all its types, except for the optional parameters, as nullary metafunctions whose typedef 'type' member is the actual type used.
The metafunction types and return:
- HasStatic Member = Template class generated from the TTI_HAS_STATIC_MEMBER ( or TTI_TRAIT_HAS_STATIC_MEMBER ) macro.<br />
- T = The enclosing type as a nullary metafunction.<br />
- R = The return type of the static member function as a nullary metafunction.<br />
- P... = The parameter types of the static member function, each as a nullary metafunction.<br />
- There can be up to TTI_MAX_PARAMETERS number of parameters. The default is 10.
+ HasStaticMemberFunction = template class generated from the TTI_HAS_STATIC_MEMBER_FUNCTION ( or TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION ) macro.<br />
+ T = the enclosing type as a nullary metafunction.<br />
+ R = the return type of the static member function as a nullary metafunction.<br />
+ FS = an optional parameter which are the parameters of the static member function, each as a nullary metafunction, as a boost::mpl forward sequence.<br />
+ TAG = an optional parameter which is a boost::function_types tag to apply to the static member function.
- returns = 'value' is true if the static member function exists within the enclosing type,
+ returns = 'value' is true if the member function exists within the enclosing type,
otherwise 'value' is false.
*/
template
<
- template<class,class> class HasStaticMember,
+ template<class,class,class,class> class HasStaticMemberFunction,
class T,
class R,
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(TTI_MAX_PARAMETERS,class P,tti::detail::noparam)
+ class FS = boost::mpl::vector<>,
+ class TAG = boost::function_types::null_tag
>
- struct mf_has_static_function :
- tti::detail::eval
+ struct mf_has_static_member_function :
+ tti::detail::mf_eval_function
<
- HasStaticMember
+ HasStaticMemberFunction
<
T,
- tti::detail::eval
- <
- tti::detail::tfunction
- <
- R,
- BOOST_PP_ENUM_PARAMS(TTI_MAX_PARAMETERS,P)
- >
- >
+ R,
+ FS,
+ TAG
>
>
{
@@ -1199,9 +1361,9 @@
The metafunction types and return:
- HasStaticMember = Template class generated from the TTI_HAS_STATIC_MEMBER ( or TTI_TRAIT_HAS_STATIC_MEMBER ) macro.<br />
- T = The enclosing type as a nullary metafunction.<br />
- R = The type of the static member data as a nullary metafunction.
+ HasStaticMember = template class generated from the TTI_HAS_STATIC_MEMBER ( or TTI_TRAIT_HAS_STATIC_MEMBER ) macro.<br />
+ T = the enclosing type as a nullary metafunction.<br />
+ R = the type of the static member data as a nullary metafunction.
returns = 'value' is true if the member data exists within the enclosing type,
otherwise 'value' is false.
Modified: sandbox/tti/boost/tti/detail/TTIntrospectionDetail.hpp
==============================================================================
--- sandbox/tti/boost/tti/detail/TTIntrospectionDetail.hpp (original)
+++ sandbox/tti/boost/tti/detail/TTIntrospectionDetail.hpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -5,7 +5,9 @@
#include <boost/mpl/bool.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <boost/mpl/not.hpp>
+#include <boost/mpl/push_front.hpp>
#include <boost/mpl/remove.hpp>
+#include <boost/mpl/transform.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
@@ -18,7 +20,6 @@
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_shifted.hpp>
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/function_types/member_function_pointer.hpp>
#include <boost/function_types/function_type.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -220,6 +221,158 @@
BOOST_PP_CAT(typename P,n::type) \
/**/
+#if defined(BOOST_NO_NULLPTR)
+
+#define TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \
+ template<class T,class C> \
+ struct trait \
+ { \
+ template<T> \
+ struct helper; \
+ \
+ template<class U> \
+ static ::boost::type_traits::yes_type check(helper<&U::name> *); \
+ \
+ template<class U> \
+ static ::boost::type_traits::no_type check(...); \
+ \
+ BOOST_STATIC_CONSTANT(bool,value=sizeof(check<C>(0))==sizeof(::boost::type_traits::yes_type)); \
+ \
+ typedef boost::mpl::bool_<value> type; \
+ }; \
+/**/
+
+#else // !defined(BOOST_NO_NULLPTR)
+
+#define TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \
+ template<class T,class C> \
+ struct trait \
+ { \
+ template<T> \
+ struct helper; \
+ \
+ template<class U> \
+ static ::boost::type_traits::yes_type check(helper<&U::name> *); \
+ \
+ template<class U> \
+ static ::boost::type_traits::no_type check(...); \
+ \
+ BOOST_STATIC_CONSTANT(bool,value=sizeof(check<C>(nullptr))==sizeof(::boost::type_traits::yes_type)); \
+ \
+ typedef boost::mpl::bool_<value> type; \
+ }; \
+/**/
+
+#endif // defined(BOOST_NO_NULLPTR)
+
+#if defined(BOOST_MSVC)
+
+#define TTI_DETAIL_TRAIT_HAS_MEMBER_DATA(trait,name) \
+ template<class T,class C> \
+ struct trait \
+ { \
+ template<class> \
+ struct return_of; \
+ \
+ template<class R,class C> \
+ struct return_of<R C::*> \
+ { \
+ typedef R type; \
+ }; \
+ \
+ template<bool,typename U> \
+ struct menable_if; \
+ \
+ template<typename U> \
+ struct menable_if<true,U> \
+ { \
+ typedef U type; \
+ }; \
+ \
+ template<typename U,typename V> \
+ static ::boost::type_traits::yes_type check2(V U::*); \
+ \
+ template<typename U,typename V> \
+ static ::boost::type_traits::no_type check2(U); \
+ \
+ template<typename U,typename V> \
+ static typename \
+ menable_if \
+ < \
+ sizeof(check2<U,V>(&U::name))==sizeof(::boost::type_traits::yes_type), \
+ ::boost::type_traits::yes_type \
+ > \
+ ::type \
+ has_matching_member(int); \
+ \
+ template<typename U,typename V> \
+ static ::boost::type_traits::no_type has_matching_member(...); \
+ \
+ template<class U,class V> \
+ struct ttc_md \
+ { \
+ typedef boost::mpl::bool_<sizeof(has_matching_member<V,typename return_of<U>::type>(0))==sizeof(::boost::type_traits::yes_type)> type; \
+ }; \
+ \
+ typedef typename ttc_md<T,C>::type type; \
+ \
+ BOOST_STATIC_CONSTANT(bool,value=type::value); \
+ \
+ }; \
+/**/
+
+#else // !defined(BOOST_MSVC)
+
+#define TTI_DETAIL_TRAIT_HAS_MEMBER_DATA(trait,name) \
+ TTI_DETAIL_TRAIT_HAS_MEMBER_FUNCTION(trait,name) \
+/**/
+
+#endif // defined(BOOST_MSVC)
+
+#if defined(BOOST_NO_NULLPTR)
+
+#define TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
+ template<class T,class Type> \
+ struct trait \
+ { \
+ template<Type *> \
+ struct helper; \
+ \
+ template<class U> \
+ static ::boost::type_traits::yes_type check(helper<&U::name> *); \
+ \
+ template<class U> \
+ static ::boost::type_traits::no_type check(...); \
+ \
+ BOOST_STATIC_CONSTANT(bool,value=sizeof(check<T>(0))==sizeof(::boost::type_traits::yes_type)); \
+ \
+ typedef boost::mpl::bool_<value> type; \
+ }; \
+/**/
+
+#else // !defined(BOOST_NO_NULLPTR)
+
+#define TTI_DETAIL_TRAIT_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
+ template<class T,class Type> \
+ struct trait \
+ { \
+ template<Type *> \
+ struct helper; \
+ \
+ template<class U> \
+ static ::boost::type_traits::yes_type check(helper<&U::name> *); \
+ \
+ template<class U> \
+ static ::boost::type_traits::no_type check(...); \
+ \
+ BOOST_STATIC_CONSTANT(bool,value=sizeof(check<T>(nullptr))==sizeof(::boost::type_traits::yes_type)); \
+ \
+ typedef boost::mpl::bool_<value> type; \
+ }; \
+/**/
+
+#endif // defined(BOOST_NO_NULLPTR)
+
#if !defined(TTI_MAX_PARAMETERS) || TTI_MAX_PARAMETERS < 1 || TTI_MAX_PARAMETERS > 254
#define TTI_MAX_PARAMETERS 10
#endif
@@ -258,19 +411,69 @@
#endif
+ template <class T>
+ struct tself : T
+ {
+ };
+
+ template<class T>
+ struct mf_eval_function;
+
template
<
+ template
+ <
+ class,
+ class,
+ class,
+ class
+ >
+ class TC,
class T,
class R,
- BOOST_PP_ENUM_PARAMS(TTI_MAX_PARAMETERS,class P)
+ class FS,
+ class TAG
>
- struct ptmf
+ struct mf_eval_function<TC<T,R,FS,TAG> > :
+ TC
+ <
+ typename T::type,
+ typename R::type,
+ typename boost::mpl::transform<FS,tself<boost::mpl::_1> >::type,
+ TAG
+ >
{
- typedef boost::mpl::vector<R,T,BOOST_PP_ENUM_PARAMS(TTI_MAX_PARAMETERS,P) > fseq;
- typedef typename boost::mpl::remove<fseq,tti::detail::noparam>::type ftseq;
- typedef typename boost::function_types::member_function_pointer<ftseq>::type type;
};
-
+
+ template
+ <
+ class T,
+ class R,
+ class FS,
+ class TAG
+ >
+ struct mf_ptmf_seq
+ {
+ typedef typename boost::mpl::transform<FS,tself<boost::mpl::_1> >::type tfs;
+ typedef typename boost::mpl::push_front<tfs,typename T::type>::type tfs1;
+ typedef typename boost::mpl::push_front<tfs1,typename R::type>::type tfs2;
+ typedef typename boost::function_types::member_function_pointer<tfs2,TAG>::type type;
+ };
+
+ template
+ <
+ class T,
+ class R,
+ class FS,
+ class TAG
+ >
+ struct ptmf_seq
+ {
+ typedef typename boost::mpl::push_front<FS,T>::type tfs1;
+ typedef typename boost::mpl::push_front<tfs1,R>::type tfs2;
+ typedef typename boost::function_types::member_function_pointer<tfs2,TAG>::type type;
+ };
+
template
<
class T,
@@ -284,13 +487,26 @@
template
<
class R,
- BOOST_PP_ENUM_PARAMS(TTI_MAX_PARAMETERS,class P)
+ class FS,
+ class TAG
+ >
+ struct tfunction_seq
+ {
+ typedef typename boost::mpl::push_front<FS,R>::type ftseq;
+ typedef typename boost::function_types::function_type<ftseq,TAG>::type type;
+ };
+
+ template
+ <
+ class R,
+ class FS,
+ class TAG
>
- struct tfunction
+ struct mf_tfunction_seq
{
- typedef boost::mpl::vector<R,BOOST_PP_ENUM_PARAMS(TTI_MAX_PARAMETERS,P) > fseq;
- typedef typename boost::mpl::remove<fseq,tti::detail::noparam>::type ftseq;
- typedef typename boost::function_types::function_type<ftseq>::type type;
+ typedef typename boost::mpl::transform<FS,tself<boost::mpl::_1> >::type fseq;
+ typedef typename boost::mpl::push_front<fseq,typename R::type>::type ftseq;
+ typedef typename boost::function_types::function_type<ftseq,TAG>::type type;
};
template
Modified: sandbox/tti/libs/tti/doc/Jamfile.v2
==============================================================================
--- sandbox/tti/libs/tti/doc/Jamfile.v2 (original)
+++ sandbox/tti/libs/tti/doc/Jamfile.v2 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -18,13 +18,12 @@
using auto-index ;
project tti_doc : requirements
<auto-index>on
- <auto-index-type>appendix
<auto-index-script>index.idx
<auto-index-prefix>../../../
<auto-index-verbose>on
<format>html:<auto-index-internal>on
<format>html:<xsl:param>generate.index=0
- <format>pdf:<auto-index-internal>off
+ <format>pdf:<auto-index-internal>on
<format>pdf:<xsl:param>index.on.type=1
<quickbook-define>enable_index ;
}
@@ -95,5 +94,9 @@
: <location>html ;
install images : [ glob $(BOOST_ROOT)/doc/src/images/*.png ]
: <location>html/images ;
+install pdfinstall
+ : standalone
+ : <location>$(here) <install-type>PDF <name>TypeTraitsIntrospection.pdf
+ ;
explicit css ;
explicit images ;
Modified: sandbox/tti/libs/tti/doc/TTIDetail.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTIDetail.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTIDetail.qbk 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -7,8 +7,7 @@
complex one where the first macro parameter, called 'trait', designates
the name of the metafunction and the second macro parameter designates the 'name' to be
introspected. Other than that difference, the two forms of the macro produce the exact same
-results. All of the introspecting macros create a metafunction whose boolean 'value'
-specifies whether or not the inner element exists.
+results.
To use these metafunctions you need to include the main header file 'TTIntrospection.hpp',
unless otherwise noted.
@@ -19,7 +18,9 @@
[link sectti_usingMM "Using the Macro Metafunctions"] section.
In the Template column only the name generated by the simple form
of the template is given since the name generated by the complex form is always tti::trait
-where 'trait' is the first parameter to the corresponding complex form macro.
+where 'trait' is the first parameter to the corresponding complex form macro. All of the
+introspecting metafunctions in the table below return a boolean constant called 'value', which
+specifies whether or not the inner element exists.
[table:tbmacros TTI Macros
[
@@ -30,7 +31,7 @@
[
[Type]
[
- [macroref TTI_HAS_TYPE TTI\_HAS\_TYPE](name)
+ [macroref TTI_HAS_TYPE](name)
]
[
tti::has\_type\_'name'
@@ -41,18 +42,20 @@
[
[Type with check]
[
- [macroref TTI_HAS_TYPE TTI\_HAS\_TYPE](name)
+ [macroref TTI_HAS_TYPE](name)
]
[
tti::has\_type\_'name'
- class T = enclosing type,class U = type to check against
+ class T = enclosing type
+
+ class U = type to check against
]
]
[
[Class Template]
[
- [macroref TTI_HAS_TEMPLATE TTI\_HAS\_TEMPLATE](name)
+ [macroref TTI_HAS_TEMPLATE](name)
]
[
tti::has\_template\_'name'
@@ -65,7 +68,7 @@
[
[Class Template with params]
[
- [macroref TTI_HAS_TEMPLATE_CHECK_PARAMS TTI\_HAS\_TEMPLATE\_CHECK\_PARAMS](name,ppSeq[footnote A Boost PP data sequence with each comma separated portion of the template parameters as its own sequence element.])
+ [macroref TTI_HAS_TEMPLATE_CHECK_PARAMS](name,ppSeq[footnote A Boost PP data sequence with each comma separated portion of the template parameters as its own sequence element.])
]
[
tti::has\_template\_check\_params\_'name'
@@ -76,7 +79,7 @@
[
[Class Template with params using variadic macros[footnote Header file is TTIntrospectionVM.hpp.]]
[
- [macroref TTI_VM_HAS_TEMPLATE_CHECK_PARAMS TTI\_VM\_HAS\_TEMPLATE\_CHECK\_PARAMS](name,...[footnote The template parameters as variadic data.])
+ [macroref TTI_VM_HAS_TEMPLATE_CHECK_PARAMS](name,...[footnote The template parameters as variadic data.])
]
[
tti::has\_template\_check\_params\_'name'
@@ -85,9 +88,9 @@
]
]
[
- [Data or function member]
+ [Member data or function]
[
- [macroref TTI_HAS_MEMBER TTI\_HAS\_MEMBER](name)
+ [macroref TTI_HAS_MEMBER](name)
]
[
tti::has\_member\_'name'
@@ -100,14 +103,69 @@
]
]
[
- [Static data or static function member]
+ [Member data as individual types]
+ [
+ [macroref TTI_HAS_MEMBER_DATA](name)
+ ]
+ [
+ tti::has\_member\_data\_'name'
+
+ class T = enclosing type
+
+ class R = data type
+ ]
+ ]
+ [
+ [Member function as individual types]
+ [
+ [macroref TTI_HAS_MEMBER_FUNCTION](name)
+ ]
+ [
+ tti::has\_member\_function\_'name'
+
+ class T = enclosing type
+
+ class R = return type
+
+ class FS = (optional) function parameter types as a Boost MPL forward sequence.
+ If there are no function parameters this does not have to be specified.
+
+ class TAG = (optional) Boost function_types tag type.
+ ]
+ ]
+ [
+ [Static member data or static member function]
[
- [macroref TTI_HAS_STATIC_MEMBER TTI\_HAS\_STATIC\_MEMBER](name)
+ [macroref TTI_HAS_STATIC_MEMBER](name)
]
[
tti::has\_static\_member\_'name'
- class T = enclosing type,class Type = data or function type
+ class T = enclosing type
+
+ class Type = data or function type
+
+ The form for Type is just 'Type' as a data type
+
+ The form for Type is 'ReturnType (Zero or more comma-separated parameter types)' as a function type
+ ]
+ ]
+ [
+ [Static member function as individual types]
+ [
+ [macroref TTI_HAS_STATIC_MEMBER_FUNCTION](name)
+ ]
+ [
+ tti::has\_static\_member\_function\_'name'
+
+ class T = enclosing type
+
+ class R = return type
+
+ class FS = (optional) function parameter types as a Boost MPL forward sequence.
+ If there are no function parameters this does not have to be specified.
+
+ class TAG = (optional) Boost function_types tag type.
]
]
]
@@ -126,18 +184,21 @@
[
[Type]
[
- [macroref TTI_MEMBER_TYPE TTI\_MEMBER\_TYPE](name)
+ [macroref TTI_MEMBER_TYPE](name)
]
[
tti::member\_type\_'name'
class T = enclosing type
+
+ returns = the type of 'name' if it exists, else an unspecified type, as a typedef 'type'.
+ Also returns a boolean constant which is true if 'name' exists, else false, called 'valid'.
]
]
]
The usefulness of this macro, and its corresponding metafunction, will be shown
-in the next topic when I explain the problem of nested types and how TTI solves
+in the next topic when I explain the problem of specifying nested types and how TTI solves
it.
[endsect]
Modified: sandbox/tti/libs/tti/doc/TTIFunctionality.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTIFunctionality.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTIFunctionality.qbk 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -15,7 +15,7 @@
These are the compile-time questions which the TTI library answers.
All of the questions above attempt to find an answer about an inner element with
-a particular name. In order to do this using template metaprogramming macros are used
+a particular name. In order to do this using template metaprogramming, macros are used
so that the name of the inner element can be passed to the macro. The macro will then
generate an appropriate metafunction, which the template metaprogrammer can then use to
introspect the information that is needed. The name itself of the inner element is always passed
Modified: sandbox/tti/libs/tti/doc/TTIHistory.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTIHistory.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTIHistory.qbk 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -4,6 +4,19 @@
* Library now compiles with gcc 3.4.2 and gcc 3.4.5.
* Examples of use have been added to the documentation.
+* TTI_HAS_TYPE and tti::mf_has_type now have optional typedef checking.
+* New macro metafunction functionality which allows composite typed to be treated as individual types has been implemented. These include:
+ * TTI_HAS_MEMBER_DATA
+ * TTI_HAS_MEMBER_FUNCTION
+ * TTI_HAS_STATIC_MEMBER_FUNCTION
+* New nullary metafunction functionality which uses new underlying macro metafunctions. These include:
+ * tti::mf_has_static_member_function uses the new underlying TTI_HAS_STATIC_MEMBER_FUNCTION macro metafunction.
+ Its signature uses an optional MPL forward sequence for the parameter types and an optional Boost function_types tag type.
+* Breaking changes
+ * TTI_HAS_TYPE_CHECK_TYPEDEF and tti::mf_has_type_check_typedef have been removed, and the functionality in them folded into TTI_HAS_TYPE and tti::mf_has_type.
+ * tti::mf_has_static_function has been removed and its functionality moved to tti::mf_has_static_member_function ( see above ).
+ * tti::mf_member_data uses the new underlying TTI_HAS_MEMBER_DATA macro metafunction.
+ * The signature for tti::mf_has_member_function has changed to use an optional MPL forward sequence for the parameter types and an optional Boost function_types tag type.
Version 1.0
Modified: sandbox/tti/libs/tti/doc/TTIIntroduction.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTIIntroduction.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTIIntroduction.qbk 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -1,9 +1,9 @@
[section:tti_intro Introduction]
-Welcome to the Type Traits Introspection library version 1.0 .
+Welcome to the Type Traits Introspection library version 1.1 .
The Type Traits Introspection library, or TTI for short, is a library
-of macros generating metafunctions, and a set of parallel nested type
+of macros generating metafunctions, and a set of parallel nullary type
metafunctions, which provide the ability to introspect by name the
elements of a type at compile time.
@@ -13,7 +13,7 @@
a type about the existence of a specific element.
I use the word "introspect" in a very broad sense here. Normally language
-introspection means initially asking for information to be initially returned by name,
+introspection means initially asking for information to be returned by name,
which can then further be used to introspect for more specific information.
In the TTI library one must always supply the name, and use the functionality
for the correct type of inner element to find out if the particular named entity exists.
@@ -30,15 +30,15 @@
element exists within the type. These metafunctions
will be called macro metafunctions in the documentation.
* Provide corresponding metafunctions which can operate
- on each of the macro metafunctions generated.
+ on nearly each of the macro metafunctions generated.
These secondary metafunctions provide nearly
- the same set of introspection as the primary ones but
- allow nested types, which do not actually have to exist,
- to be passed in template parameters without producing
- a compiler error. They also work with individual types
- when specifying function syntax rather than a composite
- type. These metafunctions will be called nested type
- metafunctions in the documentation.
+ the same set of introspection as the macro metafunctions but
+ allow for an easier to use syntax and lazy evaluation, where
+ the types being passed are in the form of metafunctions
+ themselves. They always work with individual types
+ when specifying function and data syntax rather than a
+ composite type. These metafunctions are called 'nullary type
+ metafunctions' in the documentation.
The library is a header only library.
Modified: sandbox/tti/libs/tti/doc/TTIMetafunctions.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTIMetafunctions.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTIMetafunctions.qbk 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -1,31 +1,40 @@
-[section:tti_metafunctions Nested Type Metafunctions]
+[section:tti_metafunctions Nullary Type Metafunctions]
-The nested type metafunctions parallel the macro metafunctions but more easily allow
-nested types to be used without compiler errors and without needing to use the
-T::InnerType notation for nested types.
+The nullary type metafunctions parallel most of the macro metafunctions but more easily allow
+a syntax where nested types can be specified without needing to reach into the 'type'
+member of TTI\_MEMBER\_TYPE or its nullary type metafunction equivalent of tti::mf\_member\_type.
+Such nullary type metafunctions also offer the advantage of lazy evaluation.
For each of these metafunctions the first parameter is the class template of its corresponding macro metafunction
and the remaining parameter are 'types'. These 'types' always consist first of the enclosing type and then
possibly other types which make up the signature of whatever inner element we are introspecting. Each of these
'types' is passed as a nullary metafunction whose typedef 'type' is the actual type.
+The only exception to this use of nullary metafunctions when specifying 'types' is when a Boost
+function_types tag type, which is optional, is specified as an addition to the function signature.
+Also when dealing with a function signature and parameter types are being passed, while the
+parameter 'types' themselves are in the form of nullary metafunctions, the MPL forward sequence
+which contains the parameter 'types' should not be wrapped as a nullary metafunction.
+
For a type which is in scope, we can always use
boost::mpl::identity to create our nullary metafunction, and there can never be a compiler error for
such known types as long as such declarations for them exist. For nested types, which may or may not
exist, we can pass the result of TTI\_MEMBER\_TYPE or its equivalent
-nested type metafunction tti::mf\_member\_type ( explained later ).
+nullary type metafunction tti::mf\_member\_type ( explained later ).
To use these metafunctions you need to include the main header file 'TTIntrospection.hpp',
unless otherwise noted.
[tip The header file <boost/mpl/identity.hpp> is included by the TTI header files so you need not
manually include it in order to use boost::mpl::identity to wrap a known type as a nullary
-metafunction for the nested type metafunctions.]
+metafunction for the nullary type metafunctions. Also the header file <boost/mpl/vector.hpp> is
+included by the main TTI header file 'TTIntrospection.hpp' so if you use an MPL vector as your
+forward sequence wrapper for parameter types, you need not manually include the header file.]
A table of these metafunctions is given, based on the inner element whose
existence the metaprogrammer is introspecting. A more detailed explanation can be found
in the reference section, and examples of usage can be found in the
-[link sectti_usingNTM "Using the Nested Type Metafunctions"] section.
+[link sectti_usingNTM "Using the Nullary Type Metafunctions"] section.
All of the metafunctions are in the top-level 'tti' namespace,
all have a particular name based on the type of its functionality, and all begin with the prefix
'mf_' so as not to conflict with the macro metafunction names generated by the library.
@@ -105,7 +114,7 @@
[classref tti::mf_has_member_data]
]
[
- template<class> class HasMember
+ template<class,class> class HasMemberData
= generated macro metafunction
@@ -113,7 +122,7 @@
class R = type of member data nullary Metafunction
]
- [TTI\_HAS\_MEMBER]
+ [TTI\_HAS\_MEMBER\_DATA]
]
[
[Member function]
@@ -121,17 +130,21 @@
[classref tti::mf_has_member_function]
]
[
- template<class> class HasMember
+ template<class,class,class,class> class HasMemberFunction
= generated macro metafunction
- class T = enclosing type nullary metafunction
+ class T = enclosing type nullary metafunction
- class R = return value nullary metafunction
+ class R = return value nullary metafunction
- class Types... = parameter types as nullary metafunctions
+ class FS = (optional) a Boost MPL forward sequence of parameter types as nullary metafunctions.
+ The forward sequence as a type is not presented as a nullary metafunction.
+ If there are no parameters, this may be omitted.
+
+ class TAG = (optional) a Boost function_types tag type.
]
- [TTI\_HAS\_MEMBER]
+ [TTI\_HAS\_MEMBER\_FUNCTION]
]
[
[Static data]
@@ -152,10 +165,10 @@
[
[Static function]
[
- [classref tti::mf_has_static_function]
+ [classref tti::mf_has_static_member_function]
]
[
- template<class,class> class HasStaticMember
+ template<class,class,class,class> class HasStaticMemberFunction
= generated macro metafunction
@@ -163,25 +176,28 @@
class R = return value nullary metafunction
- class Types... = parameter types as nullary metafunctions
+ class FS = (optional) a Boost MPL forward sequence of parameter types as nullary metafunctions.
+ The forward sequence as a type is not presented as a nullary metafunction.
+ If there are no parameters, this may be omitted.
+
+ class TAG = (optional) a Boost function_types tag type.
]
- [TTI\_HAS\_STATIC\_MEMBER]
+ [TTI\_HAS\_STATIC\_MEMBER\_FUNCTION]
]
]
-Other than the use of all types as nullary metafunctions, one other difference
-in the nested type metafunctions from their macro metafunction counterparts is
+Other than the use of nearly all types as nullary metafunctions, one other difference
+in the nullary type metafunctions from their macro metafunction counterparts is
that the signature for member functions, member data, and static member functions
-is broken down into individual types, rather than the combined type notation which
-the macro metafunctions use. This allows us to specify nested types
-in those signatures without using the T::InnerType notation. One can even take our
-nested types and create new types from them.
+is always broken down into individual types, rather than the combined type notation which
+some of the macro metafunctions use. This allows us to specify nested types
+in those signatures without using the T::InnerType notation.
-[heading Nested type metafunction member_type equivalent]
+[heading Nullary type metafunction member_type equivalent]
Just as there is the macro TTI\_MEMBER\_TYPE for creating
a macro metafunction which returns a nested type if it exists, else an unspecified
-type, there is also the equivalent metafunction.
+type, there is also the equivalent nullary type metafunction.
[table:tbmetanested TTI Nested Type Metafunction
[
@@ -257,15 +273,15 @@
>
> MyFindType;
-The nested type created can be used with the other nested type metafunctions above.
+The nested type created can be used with the other nullary type metafunctions above.
The key information above is that the enclosing type is a nullary metafunction,
which means that the enclosing type can be specified as the result
of using TTI\_MEMBER\_TYPE as well as the
result of using mf\_member\_type itself. Both techniques are shown in the example
above, and the same technique for creating nested types as nullary metafunctions
-can be used with the other functionality of the nested type metafunctions when
+can be used with the other functionality of the nullary type metafunctions when
nested types are needed as 'types'.
-In our next section we will look at examples of nested type metafunction use.
+In our next section we will look at examples of nullary type metafunction use.
[endsect]
Modified: sandbox/tti/libs/tti/doc/TTINestedType.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTINestedType.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTINestedType.qbk 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -7,9 +7,7 @@
or instantiating the macro metafunctions created by them, and whether the inner element exists
or not. In this sense The TTI library macros for introspecting an enclosing type for
an inner element work very well. But there is one exception to this general case.
-That exception is the crux of the discussion regarding nested types which follows,
-and explains the reason for the separate group of TTI nested type metafunctions which mirror the
-functionality of the macros and their generated macro metafunctions.
+That exception is the crux of the discussion regarding nested types which follows.
The metafunctions generated by the TTI macros all work with types, whether in specifying
an enclosing type or in specifying the type of some inner element, which may also involve
@@ -42,7 +40,7 @@
[heading The solution]
-The TTI library offers a better solution in the form of a set of constructs which work with
+The TTI library offers a better solution in the form of constructs which work with
nested types without producing a compiler error if the nested type does not exist, but still
are able to do the introspecting for inner elements that our TTI macro metafunctions do.
@@ -123,7 +121,7 @@
FindType has a static member data called MyData of type 'int', even if FindType does not actually
exist as we have specified it as a type.
-As an alternative we can also directly find out whether the deeply nested type 'FindType'
+We can also directly find out whether the deeply nested type 'FindType'
actually exists in a similar manner. Our metafunction would be:
TTI_HAS_TYPE(FindType)
@@ -158,17 +156,36 @@
directly instead of replicating the same functionality with our 'tti::has_type_FindType' metafunction.
+The using of TTI\_MEMBER\_TYPE to create a nested type which may or may not exist, and which can
+subsequently be used with our macro metafunctions whenever a nested type is required, without producing
+a compiler error when the type does not actually exist, is the main reason we have separate
+but similar functionality to determine whether a member data, a member function, or a static member
+function exists within an enclosing type.
+
+In the more general form, using TTI\_HAS\_MEMBER and TTI\_HAS\_STATIC\_MEMBER, the signature for the member
+data, member function, and the function portion of a static member function is a composite type. This makes
+for a syntactical notation which is easy to denotate, but we
+can not use the nested type functionality in TTI\_MEMBER\_TYPE within this notation very easily. But
+when we use the TTI\_HAS\_MEMBER\_DATA, TTI\_HAS\_MEMBER\_FUNCTION, and TTI\_HAS\_STATIC\_MEMBER\_FUNCTION
+the composite types in our signatures are broken down into their individual types so that using
+TTI\_MEMBER\_TYPE, if necessary, for one of the individual types is easy.
+
[heading A more elegant solution]
Although using TTI\_MEMBER\_TYPE represents a good solution to creating a nested type
without the possible compile-time error of the T::InnerType syntax, reaching in to
specify all those ::type expressions, along with their repeated 'typename',
-does get syntactically tedious. Because of this the TTI library offers a parallel set of
-metafunctions to the macro metafunctions where the 'types' used are themselves nullary
-metafunctions. Furthermore, composite types are broken down into a notation of individual
-types so that nested types can be more easily passed to these metafunctions in the formation
-of data and function signatures. This parallel set of metafunctions, using nullary
-metafunctions to specify individual types, are called 'nested type metafunctions' and are
+does get syntactically tedious.
+
+Because of this the TTI library offers a parallel set of
+metafunctions to the macro metafunctions where the 'types' specified are themselves nullary
+metafunctions and which, as with all metafunctions, lazy evaluation can take place.
+This parallel set of metafunctions, using nullary metafunctions to specify individual types,
+are called 'nullary type metafunctions'. In this group there is also a nullary metafunction
+paralleling our TTI\_MEMBER\_TYPE macro metafunction, and therefore a further construct
+making the specifying of nested types easy and error-free to use.
+
+This group of nullary metafunctions will be
fully explained later after we give some examples of macro metafunction use.
[endsect]
Modified: sandbox/tti/libs/tti/doc/TTIToDo.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTIToDo.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTIToDo.qbk 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -1,6 +1,5 @@
[section:tti_todo ToDo]
-* Use FunctionTypes tag type for the function nested metafunctions.
* Create metafunctions that work with mpl lambda expressions.
* See if function templates can be introspected.
Modified: sandbox/tti/libs/tti/doc/TTIUsingMM.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTIUsingMM.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTIUsingMM.qbk 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -136,7 +136,7 @@
T
>
-[heading Member data]
+[heading Member data with composite type]
Does T have a member data called 'IntBT' whose type is 'AType::BType' ?
@@ -147,7 +147,19 @@
AType::BType T::*
>
-[heading Member function]
+[heading Member data with individual types]
+
+Does T have a member data called 'IntBT' whose type is 'AType::BType' ?
+
+ TTI_HAS_MEMBER_DATA(IntBT)
+
+ tti::has_member_data_IntBT
+ <
+ T,
+ AType::BType
+ >
+
+[heading Member function with composite type]
Does T have a member function called 'IntFunction' whose type is
'int (short)' ?
@@ -159,6 +171,20 @@
int (T::*)(short)
>
+[heading Member function with individual types]
+
+Does T have a member function called 'IntFunction' whose type is
+'int (short)' ?
+
+ TTI_HAS_MEMBER_FUNCTION(IntFunction)
+
+ tti::has_member_function_IntFunction
+ <
+ T,
+ int,
+ boost::mpl::vector<short>
+ >
+
[heading Static member data]
Does T have a static member data called 'DSMember' whose type is 'short' ?
@@ -171,7 +197,7 @@
short
>
-[heading Static member function]
+[heading Static member function with composite type]
Does T have a static member function called 'SIntFunction' whose type
is 'int (long,double)' ?
@@ -184,6 +210,20 @@
int (long,double)
>
+[heading Static member function with individual types]
+
+Does T have a static member function called 'SIntFunction' whose type
+is 'int (long,double)' ?
+
+ TTI_HAS_STATIC_MEMBER(SIntFunction)
+
+ tti::has_static_member_SIntFunction
+ <
+ T,
+ int,
+ boost::mpl::vector<long,double>
+ >
+
[heading Member type]
Create a nested type T::BType::CType without creating a compiler error
Modified: sandbox/tti/libs/tti/doc/TTIUsingNTM.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTIUsingNTM.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTIUsingNTM.qbk 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -1,10 +1,10 @@
-[section:tti_usingNTM Using the Nested Type Metafunctions]
+[section:tti_usingNTM Using the Nullary Type Metafunctions]
[#sectti_usingNTM]
-Using the nested type metafunctions can be illustrated by first creating some hypothetical
+Using the nullary type metafunctions can be illustrated by first creating some hypothetical
user-defined type with corresponding nested types and other inner elements.
This user-defined type will be weighted toward showing deeply nested types and elements within
-those nested types. With this type we can illustrate the use of the nested type metafunctions. This is
+those nested types. With this type we can illustrate the use of the nullary type metafunctions. This is
just meant to serve as a model for what a type T might entail from within
a class or function template.
@@ -46,7 +46,7 @@
// Function
- int IntFunction(short) { return 0; }
+ int IntFunction(short) const { return 0; }
// Static Data
@@ -203,11 +203,11 @@
Does T have a member data called 'IntBT' whose type is 'BType' ?
- TTI_HAS_MEMBER(IntBT)
+ TTI_HAS_MEMBER_DATA(IntBT)
tti::mf_has_member_data
<
- tti::has_member_IntBT,
+ tti::has_member_data_IntBT,
boost::mpl::identity<T>,
BTypeNM
>
@@ -215,16 +215,17 @@
[heading Member function]
Does T have a member function called 'IntFunction'
-within 'BType::CType::DType' whose type is 'int (short)' ?
+within 'BType::CType::DType' whose type is 'int (short) const' ?
- TTI_HAS_MEMBER(IntFunction)
+ TTI_HAS_MEMBER_FUNCTION(IntFunction)
tti::mf_has_member_function
<
- tti::has_member_IntFunction,
+ tti::has_member_function_IntFunction,
DTypeNM,
boost::mpl::identity<int>,
- boost::mpl::identity<short>
+ boost::mpl::vector<boost::mpl::identity<short> >,
+ boost::function_types::const_qualified
>
[heading Static member data]
@@ -246,15 +247,14 @@
Does T have a static member function called 'SIntFunction'
within 'BType::CType::DType' whose type is 'int (long,double)' ?
- TTI_HAS_STATIC_MEMBER(SIntFunction)
+ TTI_HAS_STATIC_MEMBER_FUNCTION(SIntFunction)
- tti::mf_has_static_function
+ tti::mf_has_static_member_function
<
- tti::has_static_member_SIntFunction,
+ tti::has_static_member_function_SIntFunction,
DTypeNM,
boost::mpl::identity<int>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector<boost::mpl::identity<long>,boost::mpl::identity<double> >
>
[endsect]
Modified: sandbox/tti/libs/tti/test/Jamfile.v2
==============================================================================
--- sandbox/tti/libs/tti/test/Jamfile.v2 (original)
+++ sandbox/tti/libs/tti/test/Jamfile.v2 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -28,6 +28,15 @@
[ compile-fail TestHasMemberFail3.cpp ]
[ compile-fail TestHasMemberFail4.cpp ]
[ compile-fail TestHasMemberFail5.cpp ]
+ [ run TestHasMemberData.cpp ]
+ [ compile TestHasMemberDataCompile.cpp ]
+ [ compile-fail TestHasMemberDataFail.cpp ]
+ [ compile-fail TestHasMemberDataFail2.cpp ]
+ [ compile-fail TestHasMemberDataFail3.cpp ]
+ [ run TestHasMemberFunction.cpp ]
+ [ compile TestHasMemberFunctionCompile.cpp ]
+ [ compile-fail TestHasMemberFunctionFail.cpp ]
+ [ compile-fail TestHasMemberFunctionFail2.cpp ]
[ run TestHasStaticMember.cpp ]
[ compile TestHasStaticMemberCompile.cpp ]
[ compile-fail TestHasStaticMemberFail.cpp ]
@@ -35,6 +44,10 @@
[ compile-fail TestHasStaticMemberFail3.cpp ]
[ compile-fail TestHasStaticMemberFail4.cpp ]
[ compile-fail TestHasStaticMemberFail5.cpp ]
+ [ run TestHasStaticMemberFunction.cpp ]
+ [ compile TestHasStaticMemberFunctionCompile.cpp ]
+ [ compile-fail TestHasStaticMemberFunctionFail.cpp ]
+ [ compile-fail TestHasStaticMemberFunctionFail2.cpp ]
[ run TestHasTemplate.cpp ]
[ compile TestHasTemplateCompile.cpp ]
[ compile-fail TestHasTemplateFail.cpp ]
Added: sandbox/tti/libs/tti/test/TestHasMemberData.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberData.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,20 @@
+#include "TestHasMemberData.hpp"
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+ BOOST_TEST((tti::has_member_data_AnInt<AType,int>::value));
+ BOOST_TEST((tti::has_member_data_AnInt<AnotherType,long>::value));
+ BOOST_TEST((tti::has_member_data_aMember<AnotherType,bool>::value));
+ BOOST_TEST((!tti::has_member_data_aMember<AnotherType,int>::value));
+ BOOST_TEST((tti::CMember<AnotherType,bool>::value));
+ BOOST_TEST((!tti::has_member_data_someDataMember<AType,short>::value));
+ BOOST_TEST((tti::has_member_data_IntBT<AType,AType::BType>::value));
+ BOOST_TEST((tti::NestedData<AType,AType::BType::CType>::value));
+ BOOST_TEST((tti::AOther<AnotherType,AType>::value));
+ BOOST_TEST((tti::has_member_data_ONestStr<AnotherType,AType::AStructType>::value));
+
+ return boost::report_errors();
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasMemberData.hpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberData.hpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,16 @@
+#if !defined(TEST_HAS_MEMBER_DATA_HPP)
+#define TEST_HAS_MEMBER_DATA_HPP
+
+#include "TestStructs.hpp"
+#include <boost/tti/TTIntrospection.hpp>
+
+TTI_HAS_MEMBER_DATA(AnInt)
+TTI_HAS_MEMBER_DATA(aMember)
+TTI_TRAIT_HAS_MEMBER_DATA(CMember,cMem)
+TTI_HAS_MEMBER_DATA(someDataMember)
+TTI_HAS_MEMBER_DATA(IntBT)
+TTI_TRAIT_HAS_MEMBER_DATA(NestedData,NestedCT)
+TTI_TRAIT_HAS_MEMBER_DATA(AOther,OtherAT)
+TTI_HAS_MEMBER_DATA(ONestStr)
+
+#endif // TEST_HAS_MEMBER_DATA_HPP
Added: sandbox/tti/libs/tti/test/TestHasMemberDataCompile.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberDataCompile.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,25 @@
+#include "TestHasMemberData.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // You can always instantiate without compiler errors
+
+ tti::has_member_data_aMember<AType,long> aVar;
+ tti::has_member_data_someDataMember<AnotherType,double> aVar2;
+
+ // Compile time asserts
+
+ BOOST_MPL_ASSERT((tti::has_member_data_AnInt<AType,int>));
+ BOOST_MPL_ASSERT((tti::has_member_data_AnInt<AnotherType,long>));
+ BOOST_MPL_ASSERT((tti::has_member_data_aMember<AnotherType,bool>));
+ BOOST_MPL_ASSERT((tti::CMember<AnotherType,bool>));
+ BOOST_MPL_ASSERT((tti::has_member_data_IntBT<AType,AType::BType>));
+ BOOST_MPL_ASSERT((tti::NestedData<AType,AType::BType::CType>));
+ BOOST_MPL_ASSERT((tti::AOther<AnotherType,AType>));
+ BOOST_MPL_ASSERT((tti::has_member_data_ONestStr<AnotherType,AType::AStructType>));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasMemberDataFail.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberDataFail.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,13 @@
+#include "TestHasMemberData.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // someDataMember does not exist at all
+
+ BOOST_MPL_ASSERT(( tti::has_member_data_someDataMember<AType,short> ));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasMemberDataFail2.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberDataFail2.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,13 @@
+#include "TestHasMemberData.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Wrong data signature for aMember
+
+ BOOST_MPL_ASSERT(( tti::has_member_data_aMember<AnotherType,int> ));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasMemberDataFail3.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberDataFail3.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,12 @@
+#include "TestHasMemberData.hpp"
+
+int main()
+ {
+
+ // Data signature has type which does not exist
+
+ tti::has_member_data_aMember<AnotherType,AType::NTHType> aVar;
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasMemberFunction.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberFunction.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,17 @@
+#include "TestHasMemberFunction.hpp"
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+ BOOST_TEST((tti::has_member_function_VoidFunction<AType,void>::value));
+ BOOST_TEST((tti::FunctionReturningInt<AType,int>::value));
+ BOOST_TEST((tti::FunctionReturningInt<AnotherType,double,boost::mpl::vector<int> >::value));
+ BOOST_TEST((tti::has_member_function_aFunction<AnotherType,AType,boost::mpl::vector<int> >::value));
+ BOOST_TEST((tti::AnotherIntFunction<AnotherType,int,boost::mpl::vector<AType> >::value));
+ BOOST_TEST((tti::has_member_function_sFunction<AnotherType,AType::AnIntType,boost::mpl::vector<int,long,double> >::value));
+ BOOST_TEST((!tti::has_member_function_someFunctionMember<AnotherType,AType,boost::mpl::vector<long,int> >::value));
+
+ return boost::report_errors();
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasMemberFunction.hpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberFunction.hpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,14 @@
+#if !defined(TEST_HAS_MEMBER_FUNCTION_HPP)
+#define TEST_HAS_MEMBER_FUNCTION_HPP
+
+#include "TestStructs.hpp"
+#include <boost/tti/TTIntrospection.hpp>
+
+TTI_HAS_MEMBER_FUNCTION(VoidFunction)
+TTI_TRAIT_HAS_MEMBER_FUNCTION(FunctionReturningInt,IntFunction)
+TTI_HAS_MEMBER_FUNCTION(aFunction)
+TTI_TRAIT_HAS_MEMBER_FUNCTION(AnotherIntFunction,anotherFunction)
+TTI_HAS_MEMBER_FUNCTION(sFunction)
+TTI_HAS_MEMBER_FUNCTION(someFunctionMember)
+
+#endif // TEST_HAS_MEMBER_FUNCTION_HPP
Added: sandbox/tti/libs/tti/test/TestHasMemberFunctionCompile.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberFunctionCompile.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,22 @@
+#include "TestHasMemberFunction.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // You can always instantiate without compiler errors
+
+ tti::has_member_function_someFunctionMember<AnotherType,double,boost::mpl::vector<short,short,long,int> > aVar3;
+
+ // Compile time asserts
+
+ BOOST_MPL_ASSERT((tti::has_member_function_VoidFunction<AType,void>));
+ BOOST_MPL_ASSERT((tti::FunctionReturningInt<AType,int>));
+ BOOST_MPL_ASSERT((tti::FunctionReturningInt<AnotherType,double,boost::mpl::vector<int> >));
+ BOOST_MPL_ASSERT((tti::has_member_function_aFunction<AnotherType,AType,boost::mpl::vector<int> >));
+ BOOST_MPL_ASSERT((tti::AnotherIntFunction<AnotherType,int,boost::mpl::vector<AType> >));
+ BOOST_MPL_ASSERT((tti::has_member_function_sFunction<AnotherType,AType::AnIntType,boost::mpl::vector<int,long,double> >));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasMemberFunctionFail.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberFunctionFail.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,13 @@
+#include "TestHasMemberFunction.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Wrong function signature for sFunction
+
+ BOOST_MPL_ASSERT((tti::has_member_function_sFunction<AnotherType,AType::AnIntType,boost::mpl::vector<short,long,double> >));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasMemberFunctionFail2.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasMemberFunctionFail2.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,12 @@
+#include "TestHasMemberFunction.hpp"
+
+int main()
+ {
+
+ // Function signature has type which does not exist
+
+ tti::has_member_function_sFunction<NVType,AType::AnIntType,boost::mpl::vector<short,long,double> > aVar;
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasStaticMemberFunction.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFunction.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,15 @@
+#include "TestHasStaticMemberFunction.hpp"
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+ BOOST_TEST((tti::HaveTheSIntFunction<AType,int,boost::mpl::vector<long,double> >::value));
+ BOOST_TEST((!tti::TheTIntFunction<AType,AType,boost::mpl::vector<long,double> >::value));
+ BOOST_TEST((tti::TheTIntFunction<AnotherType,AType,boost::mpl::vector<long,double> >::value));
+ BOOST_TEST((tti::has_static_member_function_TSFunction<AnotherType,AType::AStructType,boost::mpl::vector<AType::AnIntType,double> >::value));
+ BOOST_TEST((!tti::Pickedname<AnotherType,void>::value));
+
+ return boost::report_errors();
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasStaticMemberFunction.hpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFunction.hpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,12 @@
+#if !defined(TEST_HAS_STATIC_MEMBER_FUNCTION_HPP)
+#define TEST_HAS_STATIC_MEMBER_FUNCTION_HPP
+
+#include "TestStructs.hpp"
+#include <boost/tti/TTIntrospection.hpp>
+
+TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(HaveTheSIntFunction,SIntFunction)
+TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(TheTIntFunction,TIntFunction)
+TTI_HAS_STATIC_MEMBER_FUNCTION(TSFunction)
+TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(Pickedname,SomeStaticFunction)
+
+#endif // TEST_HAS_STATIC_MEMBER_FUNCTION_HPP
Added: sandbox/tti/libs/tti/test/TestHasStaticMemberFunctionCompile.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFunctionCompile.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,20 @@
+#include "TestHasStaticMemberFunction.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // You can always instantiate without compiler errors
+
+ tti::TheTIntFunction<AType,void,boost::mpl::vector<long,double> > aVar;
+ tti::Pickedname<AnotherType,AType,boost::mpl::vector<long,long> > aVar3;
+
+ // Compile time asserts
+
+ BOOST_MPL_ASSERT((tti::HaveTheSIntFunction<AType,int,boost::mpl::vector<long,double> >));
+ BOOST_MPL_ASSERT((tti::TheTIntFunction<AnotherType,AType,boost::mpl::vector<long,double> >));
+ BOOST_MPL_ASSERT((tti::has_static_member_function_TSFunction<AnotherType,AType::AStructType,boost::mpl::vector<AType::AnIntType,double> >));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasStaticMemberFunctionFail.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFunctionFail.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,13 @@
+#include "TestHasStaticMemberFunction.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Wrong function signature for SIntFunction
+
+ BOOST_MPL_ASSERT((tti::HaveTheSIntFunction<AType,int,boost::mpl::vector<float,double> >));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestHasStaticMemberFunctionFail2.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFunctionFail2.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -0,0 +1,12 @@
+#include "TestHasStaticMemberFunction.hpp"
+
+int main()
+ {
+
+ // Function signature has type which does not exist
+
+ tti::has_static_member_TSFunction<AnotherType,AType::AClassType,boost::mpl::vector<AType::AnIntType,double> > aVar;
+
+ return 0;
+
+ }
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberData.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberData.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberData.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -6,7 +6,7 @@
BOOST_TEST((tti::mf_has_member_data
<
- tti::has_member_AnInt,
+ tti::has_member_data_AnInt,
boost::mpl::identity<AType>,
boost::mpl::identity<int>
>
@@ -15,7 +15,7 @@
BOOST_TEST((tti::mf_has_member_data
<
- tti::has_member_AnInt,
+ tti::has_member_data_AnInt,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<long>
>
@@ -24,7 +24,7 @@
BOOST_TEST((tti::mf_has_member_data
<
- tti::has_member_aMember,
+ tti::has_member_data_aMember,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<bool>
>
@@ -42,7 +42,7 @@
BOOST_TEST((tti::mf_has_member_data
<
- tti::has_member_IntBT,
+ tti::has_member_data_IntBT,
boost::mpl::identity<AType>,
tti::member_type_BType<AType>
>
@@ -73,7 +73,7 @@
BOOST_TEST((tti::mf_has_member_data
<
- tti::has_member_ONestStr,
+ tti::has_member_data_ONestStr,
boost::mpl::identity<AnotherType>,
tti::member_type_AStructType<AType>
>
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberData.hpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberData.hpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberData.hpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -4,14 +4,14 @@
#include "TestStructs.hpp"
#include <boost/tti/TTIntrospection.hpp>
-TTI_HAS_MEMBER(AnInt)
-TTI_HAS_MEMBER(aMember)
-TTI_TRAIT_HAS_MEMBER(CMember,cMem)
-TTI_HAS_MEMBER(someDataMember)
-TTI_HAS_MEMBER(IntBT)
-TTI_TRAIT_HAS_MEMBER(NestedData,NestedCT)
-TTI_TRAIT_HAS_MEMBER(AOther,OtherAT)
-TTI_HAS_MEMBER(ONestStr)
+TTI_HAS_MEMBER_DATA(AnInt)
+TTI_HAS_MEMBER_DATA(aMember)
+TTI_TRAIT_HAS_MEMBER_DATA(CMember,cMem)
+TTI_HAS_MEMBER_DATA(someDataMember)
+TTI_HAS_MEMBER_DATA(IntBT)
+TTI_TRAIT_HAS_MEMBER_DATA(NestedData,NestedCT)
+TTI_TRAIT_HAS_MEMBER_DATA(AOther,OtherAT)
+TTI_HAS_MEMBER_DATA(ONestStr)
TTI_MEMBER_TYPE(BType)
TTI_MEMBER_TYPE(CType)
TTI_MEMBER_TYPE(AStructType)
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberDataCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberDataCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberDataCompile.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -6,7 +6,7 @@
BOOST_MPL_ASSERT((tti::mf_has_member_data
<
- tti::has_member_AnInt,
+ tti::has_member_data_AnInt,
boost::mpl::identity<AType>,
boost::mpl::identity<int>
>
@@ -14,7 +14,7 @@
BOOST_MPL_ASSERT((tti::mf_has_member_data
<
- tti::has_member_AnInt,
+ tti::has_member_data_AnInt,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<long>
>
@@ -22,7 +22,7 @@
BOOST_MPL_ASSERT((tti::mf_has_member_data
<
- tti::has_member_aMember,
+ tti::has_member_data_aMember,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<bool>
>
@@ -38,7 +38,7 @@
BOOST_MPL_ASSERT((tti::mf_has_member_data
<
- tti::has_member_IntBT,
+ tti::has_member_data_IntBT,
boost::mpl::identity<AType>,
tti::member_type_BType<AType>
>
@@ -66,7 +66,7 @@
BOOST_MPL_ASSERT((tti::mf_has_member_data
<
- tti::has_member_ONestStr,
+ tti::has_member_data_ONestStr,
boost::mpl::identity<AnotherType>,
tti::member_type_AStructType<AType>
>
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberDataFail.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberDataFail.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberDataFail.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -8,7 +8,7 @@
BOOST_MPL_ASSERT((tti::mf_has_member_data
<
- tti::has_member_someDataMember,
+ tti::has_member_data_someDataMember,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<short>
>
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberDataFail2.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberDataFail2.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberDataFail2.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -8,7 +8,7 @@
BOOST_MPL_ASSERT((tti::mf_has_member_data
<
- tti::has_member_AnInt,
+ tti::has_member_data_AnInt,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<double>
>
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberDataFail3.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberDataFail3.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberDataFail3.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -8,7 +8,7 @@
BOOST_MPL_ASSERT((tti::mf_has_member_data
<
- tti::has_member_aMember,
+ tti::has_member_data_aMember,
boost::mpl::identity<AType>,
boost::mpl::identity<bool>
>
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberFunction.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberFunction.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberFunction.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -6,7 +6,7 @@
BOOST_TEST((tti::mf_has_member_function
<
- tti::has_member_VoidFunction,
+ tti::has_member_function_VoidFunction,
boost::mpl::identity<AType>,
boost::mpl::identity<void>
>
@@ -27,17 +27,17 @@
tti::FunctionReturningInt,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<double>,
- boost::mpl::identity<int>
+ boost::mpl::vector<boost::mpl::identity<int> >
>
::value
));
BOOST_TEST((tti::mf_has_member_function
<
- tti::has_member_aFunction,
+ tti::has_member_function_aFunction,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<AType>,
- boost::mpl::identity<int>
+ boost::mpl::vector<boost::mpl::identity<int> >
>
::value
));
@@ -47,19 +47,22 @@
tti::AnotherIntFunction,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<int>,
- boost::mpl::identity<AType>
+ boost::mpl::vector<boost::mpl::identity<AType> >
>
::value
));
BOOST_TEST((tti::mf_has_member_function
<
- tti::has_member_sFunction,
+ tti::has_member_function_sFunction,
boost::mpl::identity<AnotherType>,
tti::member_type_AnIntType<AType>,
- boost::mpl::identity<int>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<int>,
+ boost::mpl::identity<long>,
+ boost::mpl::identity<double>
+ >
>
::value
));
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberFunction.hpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberFunction.hpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberFunction.hpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -4,12 +4,12 @@
#include "TestStructs.hpp"
#include <boost/tti/TTIntrospection.hpp>
-TTI_HAS_MEMBER(VoidFunction)
-TTI_TRAIT_HAS_MEMBER(FunctionReturningInt,IntFunction)
-TTI_HAS_MEMBER(aFunction)
-TTI_TRAIT_HAS_MEMBER(AnotherIntFunction,anotherFunction)
-TTI_HAS_MEMBER(sFunction)
-TTI_HAS_MEMBER(someFunctionMember)
+TTI_HAS_MEMBER_FUNCTION(VoidFunction)
+TTI_TRAIT_HAS_MEMBER_FUNCTION(FunctionReturningInt,IntFunction)
+TTI_HAS_MEMBER_FUNCTION(aFunction)
+TTI_TRAIT_HAS_MEMBER_FUNCTION(AnotherIntFunction,anotherFunction)
+TTI_HAS_MEMBER_FUNCTION(sFunction)
+TTI_HAS_MEMBER_FUNCTION(someFunctionMember)
TTI_MEMBER_TYPE(AnIntType)
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberFunctionCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberFunctionCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberFunctionCompile.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -1,5 +1,6 @@
#include "TestMFHasMemberFunction.hpp"
#include <boost/mpl/assert.hpp>
+#include <boost/mpl/vector.hpp>
int main()
{
@@ -15,29 +16,35 @@
tti::mf_has_member_function
<
- tti::has_member_sFunction,
+ tti::has_member_function_sFunction,
boost::mpl::identity<AnotherType>,
tti::member_type_AnIntType<AnotherType>,
- boost::mpl::identity<int>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<int>,
+ boost::mpl::identity<long>,
+ boost::mpl::identity<double>
+ >
> aVar2;
tti::mf_has_member_function
<
- tti::has_member_someFunctionMember,
+ tti::has_member_function_someFunctionMember,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<short>,
- boost::mpl::identity<double>,
- boost::mpl::identity<int>,
- boost::mpl::identity<long>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<double>,
+ boost::mpl::identity<int>,
+ boost::mpl::identity<long>
+ >
> aVar3;
-
+
// Compile time asserts
BOOST_MPL_ASSERT((tti::mf_has_member_function
<
- tti::has_member_VoidFunction,
+ tti::has_member_function_VoidFunction,
boost::mpl::identity<AType>,
boost::mpl::identity<void>
>
@@ -56,16 +63,16 @@
tti::FunctionReturningInt,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<double>,
- boost::mpl::identity<int>
+ boost::mpl::vector<boost::mpl::identity<int> >
>
));
-
+
BOOST_MPL_ASSERT((tti::mf_has_member_function
<
- tti::has_member_aFunction,
+ tti::has_member_function_aFunction,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<AType>,
- boost::mpl::identity<int>
+ boost::mpl::vector<boost::mpl::identity<int> >
>
));
@@ -74,18 +81,21 @@
tti::AnotherIntFunction,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<int>,
- boost::mpl::identity<AType>
+ boost::mpl::vector<boost::mpl::identity<AType> >
>
));
BOOST_MPL_ASSERT((tti::mf_has_member_function
<
- tti::has_member_sFunction,
+ tti::has_member_function_sFunction,
boost::mpl::identity<AnotherType>,
tti::member_type_AnIntType<AType>,
- boost::mpl::identity<int>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<int>,
+ boost::mpl::identity<long>,
+ boost::mpl::identity<double>
+ >
>
));
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberFunctionFail.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberFunctionFail.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberFunctionFail.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -8,12 +8,15 @@
BOOST_MPL_ASSERT((tti::mf_has_member_function
<
- tti::has_member_someFunctionMember,
+ tti::has_member_function_someFunctionMember,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<short>,
- boost::mpl::identity<double>,
- boost::mpl::identity<int>,
- boost::mpl::identity<long>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<double>,
+ boost::mpl::identity<int>,
+ boost::mpl::identity<long>
+ >
>
));
Modified: sandbox/tti/libs/tti/test/TestMFHasMemberFunctionFail3.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasMemberFunctionFail3.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasMemberFunctionFail3.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -8,12 +8,15 @@
BOOST_MPL_ASSERT((tti::mf_has_member_function
<
- tti::has_member_sFunction,
+ tti::has_member_function_sFunction,
boost::mpl::identity<AnotherType>,
tti::member_type_AnIntType<AnotherType>,
- boost::mpl::identity<int>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<int>,
+ boost::mpl::identity<long>,
+ boost::mpl::identity<double>
+ >
>
));
Modified: sandbox/tti/libs/tti/test/TestMFHasStaticFunction.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasStaticFunction.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasStaticFunction.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -4,35 +4,44 @@
int main()
{
- BOOST_TEST((tti::mf_has_static_function
+ BOOST_TEST((tti::mf_has_static_member_function
<
tti::HaveTheSIntFunction,
boost::mpl::identity<AType>,
boost::mpl::identity<int>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<long>,
+ boost::mpl::identity<double>
+ >
>
::value
));
- BOOST_TEST((tti::mf_has_static_function
+ BOOST_TEST((tti::mf_has_static_member_function
<
tti::TheTIntFunction,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<AType>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<long>,
+ boost::mpl::identity<double>
+ >
>
::value
));
- BOOST_TEST((tti::mf_has_static_function
+ BOOST_TEST((tti::mf_has_static_member_function
<
- tti::has_static_member_TSFunction,
+ tti::has_static_member_function_TSFunction,
boost::mpl::identity<AnotherType>,
tti::member_type_AStructType<AType>,
- tti::NameIntType<AType>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ tti::NameIntType<AType>,
+ boost::mpl::identity<double>
+ >
>
::value
));
Modified: sandbox/tti/libs/tti/test/TestMFHasStaticFunction.hpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasStaticFunction.hpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasStaticFunction.hpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -4,10 +4,10 @@
#include "TestStructs.hpp"
#include <boost/tti/TTIntrospection.hpp>
-TTI_TRAIT_HAS_STATIC_MEMBER(HaveTheSIntFunction,SIntFunction)
-TTI_TRAIT_HAS_STATIC_MEMBER(TheTIntFunction,TIntFunction)
-TTI_HAS_STATIC_MEMBER(TSFunction)
-TTI_TRAIT_HAS_STATIC_MEMBER(Pickedname,SomeStaticFunction)
+TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(HaveTheSIntFunction,SIntFunction)
+TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(TheTIntFunction,TIntFunction)
+TTI_HAS_STATIC_MEMBER_FUNCTION(TSFunction)
+TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION(Pickedname,SomeStaticFunction)
TTI_MEMBER_TYPE(AStructType)
TTI_TRAIT_MEMBER_TYPE(NameIntType,AnIntType)
Modified: sandbox/tti/libs/tti/test/TestMFHasStaticFunctionCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasStaticFunctionCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasStaticFunctionCompile.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -6,52 +6,64 @@
// You can always instantiate without compiler errors
- tti::mf_has_static_function
+ tti::mf_has_static_member_function
<
tti::HaveTheSIntFunction,
boost::mpl::identity<AType>,
boost::mpl::identity<int>,
- boost::mpl::identity<long>,
- boost::mpl::identity<short>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<long>,
+ boost::mpl::identity<short>
+ >
> aVar;
- tti::mf_has_static_function
+ tti::mf_has_static_member_function
<
tti::Pickedname,
boost::mpl::identity<AType>,
boost::mpl::identity<double>,
- boost::mpl::identity<float>
+ boost::mpl::vector<boost::mpl::identity<float> >
> aVar2;
// Compile time asserts
- BOOST_MPL_ASSERT((tti::mf_has_static_function
+ BOOST_MPL_ASSERT((tti::mf_has_static_member_function
<
tti::HaveTheSIntFunction,
boost::mpl::identity<AType>,
boost::mpl::identity<int>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<long>,
+ boost::mpl::identity<double>
+ >
>
));
- BOOST_MPL_ASSERT((tti::mf_has_static_function
+ BOOST_MPL_ASSERT((tti::mf_has_static_member_function
<
tti::TheTIntFunction,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<AType>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<long>,
+ boost::mpl::identity<double>
+ >
>
));
- BOOST_MPL_ASSERT((tti::mf_has_static_function
+ BOOST_MPL_ASSERT((tti::mf_has_static_member_function
<
- tti::has_static_member_TSFunction,
+ tti::has_static_member_function_TSFunction,
boost::mpl::identity<AnotherType>,
tti::member_type_AStructType<AType>,
- tti::NameIntType<AType>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ tti::NameIntType<AType>,
+ boost::mpl::identity<double>
+ >
>
));
Modified: sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -6,13 +6,16 @@
// SomeStaticFunction does not exist at all
- BOOST_MPL_ASSERT((tti::mf_has_static_function
+ BOOST_MPL_ASSERT((tti::mf_has_static_member_function
<
tti::Pickedname,
boost::mpl::identity<AType>,
boost::mpl::identity<short>,
- boost::mpl::identity<int>,
- boost::mpl::identity<long>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<int>,
+ boost::mpl::identity<long>
+ >
>
));
Modified: sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail2.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail2.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail2.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -6,13 +6,16 @@
// Wrong enclosing type
- BOOST_MPL_ASSERT((tti::mf_has_static_function
+ BOOST_MPL_ASSERT((tti::mf_has_static_member_function
<
tti::HaveTheSIntFunction,
boost::mpl::identity<AnotherType>,
boost::mpl::identity<int>,
- boost::mpl::identity<long>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ boost::mpl::identity<long>,
+ boost::mpl::identity<double>
+ >
>
));
Modified: sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail3.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail3.cpp (original)
+++ sandbox/tti/libs/tti/test/TestMFHasStaticFunctionFail3.cpp 2011-02-01 20:44:12 EST (Tue, 01 Feb 2011)
@@ -6,13 +6,16 @@
// Wrong function parameter type
- BOOST_MPL_ASSERT((tti::mf_has_static_function
+ BOOST_MPL_ASSERT((tti::mf_has_static_member_function
<
- tti::has_static_member_TSFunction,
+ tti::has_static_member_function_TSFunction,
boost::mpl::identity<AnotherType>,
tti::member_type_AStructType<AType>,
- tti::NameIntType<AnotherType>,
- boost::mpl::identity<double>
+ boost::mpl::vector
+ <
+ tti::NameIntType<AnotherType>,
+ boost::mpl::identity<double>
+ >
>
));
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk