|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67598 - in sandbox/tti: boost/tti libs/tti/doc libs/tti/test
From: eldiener_at_[hidden]
Date: 2011-01-02 16:20:20
Author: eldiener
Date: 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
New Revision: 67598
URL: http://svn.boost.org/trac/boost/changeset/67598
Log:
Added metafunction and updated doc.
Added:
sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParams.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParams.hpp (contents, props changed)
sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsCompile.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsFail.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsFail2.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsFail3.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParams.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParams.hpp (contents, props changed)
sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsCompile.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsFail.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsFail2.cpp (contents, props changed)
sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsFail3.cpp (contents, props changed)
Text files modified:
sandbox/tti/boost/tti/TTIntrospection.hpp | 17 +++++++++++++++--
sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp | 16 +++++++++-------
sandbox/tti/libs/tti/doc/TTIMetafunctions.qbk | 7 +++----
sandbox/tti/libs/tti/test/Jamfile.v2 | 10 ++++++++++
sandbox/tti/libs/tti/test/TestStructs.hpp | 2 ++
sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParams.cpp | 4 ++++
sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParams.hpp | 4 ++++
sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsCompile.cpp | 4 ++++
sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail.cpp | 4 ++++
sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail2.cpp | 4 ++++
sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail3.cpp | 4 ++++
sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail4.cpp | 4 ++++
12 files changed, 67 insertions(+), 13 deletions(-)
Modified: sandbox/tti/boost/tti/TTIntrospection.hpp
==============================================================================
--- sandbox/tti/boost/tti/TTIntrospection.hpp (original)
+++ sandbox/tti/boost/tti/TTIntrospection.hpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -779,7 +779,13 @@
class T
>
struct mf_member_type :
- public mf_has_type<MemberType,T>
+ tti::detail::eval
+ <
+ MemberType
+ <
+ T
+ >
+ >
{
};
@@ -806,7 +812,14 @@
class U
>
struct mf_has_type_check_typedef :
- public mf_has_static_data<HasTypeCheckTypedef,T,U>
+ tti::detail::eval
+ <
+ HasTypeCheckTypedef
+ <
+ T,
+ U
+ >
+ >
{
};
Modified: sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp
==============================================================================
--- sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp (original)
+++ sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -1,6 +1,8 @@
#if !defined(TT_INTROSPECTION_TEMPLATE_HPP)
#define TT_INTROSPECTION_TEMPLATE_HPP
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/identity.hpp>
#include "detail/TTIntrospectionDetail.hpp"
/*
@@ -22,9 +24,8 @@
The metafunction types and return:
- HasTemplate = Template class generated from either TTI_HAS_TEMPLATE ( or TTI_TRAIT_HAS_TEMPLATE )
- or TTI_HAS_TEMPLATE_CHECK_PARAMS ( or TTI_TRAIT_HAS_TEMPLATE_CHECK_PARAMS )
- or TTI_VM_HAS_TEMPLATE_CHECK_PARAMS ( or TTI_VM_TRAIT_HAS_TEMPLATE_CHECK_PARAMS ) macros.<br />
+ HasTemplateCheckParams = Template class generated from either TTI_HAS_TEMPLATE_CHECK_PARAMS ( TTI_TRAIT_HAS_TEMPLATE_CHECK_PARAMS )
+ or TTI_VM_HAS_TEMPLATE_CHECK_PARAMS ( TTI_VM_TRAIT_HAS_TEMPLATE_CHECK_PARAMS ) macros.<br />
T = The enclosing type as a nullary metafunction.
returns = 'value' is true if the template exists within the enclosing type,
@@ -33,15 +34,16 @@
*/
template
<
- template<class> class HasTemplate,
+ template<class,class = boost::mpl::bool_< false > > class HasTemplateCheckParams,
class T
>
- struct mf_has_template :
+ struct mf_has_template_check_params :
tti::detail::eval
<
- HasTemplate
+ HasTemplateCheckParams
<
- T
+ T,
+ boost::mpl::identity<boost::mpl::bool_< false > >
>
>
{
Modified: sandbox/tti/libs/tti/doc/TTIMetafunctions.qbk
==============================================================================
--- sandbox/tti/libs/tti/doc/TTIMetafunctions.qbk (original)
+++ sandbox/tti/libs/tti/doc/TTIMetafunctions.qbk 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -57,15 +57,14 @@
[TTI\_HAS\_TYPE\_CHECK\_TYPEDEF (TTI\_TRAIT\_HAS\_TYPE\_CHECK\_TYPEDEF)]
]
[
- [Template]
- [tti::mf\_has\_template]
+ [Class Template with params]
+ [tti::mf\_has\_template_check_params]
[
- template<class,class> class HasTemplate[br]
+ template<class> class HasTemplateCheckParams[br]
= generated macro metafunction[br]
class T = enclosing type nullary metafunction
]
[
- TTI\_HAS\_TEMPLATE (TTI\_TRAIT\_HAS\_TEMPLATE)[br]
TTI\_HAS\_TEMPLATE\_CHECK\_PARAMS (TTI\_TRAIT\_HAS\_TEMPLATE\_CHECK\_PARAMS)[br]
TTI\_VM\_HAS\_TEMPLATE\_CHECK\_PARAMS (TTI\_VM\_TRAIT\_HAS\_TEMPLATE\_CHECK\_PARAMS)
]
Modified: sandbox/tti/libs/tti/test/Jamfile.v2
==============================================================================
--- sandbox/tti/libs/tti/test/Jamfile.v2 (original)
+++ sandbox/tti/libs/tti/test/Jamfile.v2 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -88,6 +88,11 @@
[ compile-fail TestMFHasTypeCheckTypedefFail.cpp ]
[ compile-fail TestMFHasTypeCheckTypedefFail2.cpp ]
[ compile-fail TestMFHasTypeCheckTypedefFail3.cpp ]
+ [ run TestMFHasTemplateCheckParams.cpp ]
+ [ compile TestMFHasTemplateCheckParamsCompile.cpp ]
+ [ compile-fail TestMFHasTemplateCheckParamsFail.cpp ]
+ [ compile-fail TestMFHasTemplateCheckParamsFail2.cpp ]
+ [ compile-fail TestMFHasTemplateCheckParamsFail3.cpp ]
[ run TestMFMemberType.cpp ]
[ compile TestMFMemberTypeCompile.cpp ]
;
@@ -100,4 +105,9 @@
[ compile-fail TestVMHasTemplateCheckParamsFail2.cpp : <include>../../../../variadic_macro_data ]
[ compile-fail TestVMHasTemplateCheckParamsFail3.cpp : <include>../../../../variadic_macro_data ]
[ compile-fail TestVMHasTemplateCheckParamsFail4.cpp : <include>../../../../variadic_macro_data ]
+ [ run TestVMMFHasTemplateCheckParams.cpp : : : <include>../../../../variadic_macro_data ]
+ [ compile TestVMMFHasTemplateCheckParamsCompile.cpp : <include>../../../../variadic_macro_data ]
+ [ compile-fail TestVMMFHasTemplateCheckParamsFail.cpp : <include>../../../../variadic_macro_data ]
+ [ compile-fail TestVMMFHasTemplateCheckParamsFail2.cpp : <include>../../../../variadic_macro_data ]
+ [ compile-fail TestVMMFHasTemplateCheckParamsFail3.cpp : <include>../../../../variadic_macro_data ]
;
Added: sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParams.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParams.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,57 @@
+#include "TestMFHasTemplateCheckParams.hpp"
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+ BOOST_TEST((tti::mf_has_template_check_params
+ <
+ tti::HT_Str,
+ tti::member_type_AStructType<AType>
+ >
+ ::value
+ ));
+
+ BOOST_TEST((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_AnotherMemberTemplate,
+ boost::mpl::identity<AType>
+ >
+ ::value
+ ));
+
+ BOOST_TEST((!tti::mf_has_template_check_params
+ <
+ tti::WrongParametersForMP,
+ boost::mpl::identity<AnotherType>
+ >
+ ::value
+ ));
+
+ BOOST_TEST((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_CTManyParameters,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ >
+ ::value
+ ));
+
+ BOOST_TEST((!tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_TemplateNotExist,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ >
+ ::value
+ ));
+
+ return boost::report_errors();
+
+ }
Added: sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParams.hpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParams.hpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,17 @@
+#if !defined(TEST_MF_HAS_TEMPLATE_CHECK_PARAMS_HPP)
+#define TEST_MF_HAS_TEMPLATE_CHECK_PARAMS_HPP
+
+#include "TestStructs.hpp"
+#include <boost/tti/TTIntrospection.hpp>
+
+TTI_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(HT_Str,MStrMemberTemplate,(class))
+TTI_HAS_TEMPLATE_CHECK_PARAMS(AnotherMemberTemplate,(int)(int))
+TTI_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(WrongParametersForMP,ManyParameters,(class)(class)(int)(class)(template <class> class InnerTemplate)(class)(short))
+TTI_HAS_TEMPLATE_CHECK_PARAMS(CTManyParameters,(class)(class)(int)(short)(class)(template <class)(int> class InnerTemplate)(class))
+TTI_HAS_TEMPLATE_CHECK_PARAMS(TemplateNotExist,(int)(class))
+
+TTI_MEMBER_TYPE(AStructType)
+TTI_TRAIT_MEMBER_TYPE(MT_BType,BType)
+TTI_MEMBER_TYPE(CType)
+
+#endif // TEST_MF_HAS_TEMPLATE_CHECK_PARAMS_HPP
Added: sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsCompile.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsCompile.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,48 @@
+#include "TestMFHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // You can always instantiate without compiler errors
+
+ tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_TemplateNotExist,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ > aVar;
+
+ // Compile time asserts
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::HT_Str,
+ tti::member_type_AStructType<AType>
+ >
+ ));
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_AnotherMemberTemplate,
+ boost::mpl::identity<AType>
+ >
+ ));
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_CTManyParameters,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ >
+ ));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsFail.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsFail.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,22 @@
+#include "TestMFHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Template does not exist
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_TemplateNotExist,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ >
+ ));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsFail2.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsFail2.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,22 @@
+#include "TestMFHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Wrong enclosing type
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_CTManyParameters,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ boost::mpl::identity<AType>
+ >
+ >
+ ));
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsFail3.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestMFHasTemplateCheckParamsFail3.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,18 @@
+#include "TestMFHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+ // Wrong template types
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::WrongParametersForMP,
+ boost::mpl::identity<AnotherType>
+ >
+ ));
+
+ return 0;
+
+ }
Modified: sandbox/tti/libs/tti/test/TestStructs.hpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestStructs.hpp (original)
+++ sandbox/tti/libs/tti/test/TestStructs.hpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -9,6 +9,7 @@
typedef int AnIntType;
struct AStructType
{
+ template <class> struct MStrMemberTemplate { };
};
typedef int & AnIntTypeReference;
struct BType
@@ -17,6 +18,7 @@
struct CType
{
typedef int AnotherIntegerType;
+ template <class,class,int,short,class,template <class,int> class InnerTemplate,class> struct CTManyParameters { };
};
};
Modified: sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParams.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParams.cpp (original)
+++ sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParams.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -4,6 +4,8 @@
int main()
{
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
BOOST_TEST(tti::has_template_check_params_ATPMemberTemplate<AType>::value);
BOOST_TEST(tti::HaveCL<AType>::value);
BOOST_TEST(tti::has_template_check_params_AMemberTemplate<AType>::value);
@@ -13,6 +15,8 @@
BOOST_TEST(tti::has_template_check_params_SimpleTMP<AnotherType>::value);
BOOST_TEST(!tti::has_template_check_params_TemplateNotExist<AnotherType>::value);
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
return boost::report_errors();
}
Modified: sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParams.hpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParams.hpp (original)
+++ sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParams.hpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -1,6 +1,8 @@
#if !defined(TEST_VM_HAS_TEMPLATE_CHECK_PARAMS_HPP)
#define TEST_VM_HAS_TEMPLATE_CHECK_PARAMS_HPP
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
#include "TestStructs.hpp"
#include <boost/tti/TTIntrospectionVM.hpp>
@@ -15,4 +17,6 @@
TTI_VM_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(WrongParametersForMP,ManyParameters,class,class,int,class,template <class,class> class InnerTemplate,class,long)
TTI_VM_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(WrongParameters2ForMP,ManyParameters,class,long,int,class,template <class> class InnerTemplate,class,long)
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
#endif // TEST_VM_HAS_TEMPLATE_CHECK_PARAMS_HPP
Modified: sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsCompile.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsCompile.cpp (original)
+++ sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsCompile.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -4,6 +4,8 @@
int main()
{
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
// You can always instantiate without compiler errors
tti::has_template_check_params_TemplateNotExist<AnotherType> aVar1;
@@ -18,6 +20,8 @@
BOOST_MPL_ASSERT((tti::ATemplateWithParms<AnotherType>));
BOOST_MPL_ASSERT((tti::has_template_check_params_SimpleTMP<AnotherType>));
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
return 0;
}
Modified: sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail.cpp (original)
+++ sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -4,10 +4,14 @@
int main()
{
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
// TemplateNotExist does not exist at all
BOOST_MPL_ASSERT((tti::has_template_check_params_TemplateNotExist<AType>));
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
return 0;
}
Modified: sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail2.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail2.cpp (original)
+++ sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail2.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -4,10 +4,14 @@
int main()
{
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
// Wrong enclosing type
BOOST_MPL_ASSERT((tti::HaveCL<AnotherType>));
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
return 0;
}
Modified: sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail3.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail3.cpp (original)
+++ sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail3.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -4,10 +4,14 @@
int main()
{
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
// Wrong template parameters
BOOST_MPL_ASSERT((tti::WrongParametersForMP<AnotherType>));
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
return 0;
}
Modified: sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail4.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail4.cpp (original)
+++ sandbox/tti/libs/tti/test/TestVMHasTemplateCheckParamsFail4.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -4,10 +4,14 @@
int main()
{
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
// Wrong template parameters
BOOST_MPL_ASSERT((tti::WrongParameters2ForMP<AnotherType>));
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
return 0;
}
Added: sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParams.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParams.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,61 @@
+#include "TestVMMFHasTemplateCheckParams.hpp"
+#include <boost/detail/lightweight_test.hpp>
+
+int main()
+ {
+
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
+ BOOST_TEST((tti::mf_has_template_check_params
+ <
+ tti::HT_Str,
+ tti::member_type_AStructType<AType>
+ >
+ ::value
+ ));
+
+ BOOST_TEST((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_AnotherMemberTemplate,
+ boost::mpl::identity<AType>
+ >
+ ::value
+ ));
+
+ BOOST_TEST((!tti::mf_has_template_check_params
+ <
+ tti::WrongParametersForMP,
+ boost::mpl::identity<AnotherType>
+ >
+ ::value
+ ));
+
+ BOOST_TEST((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_CTManyParameters,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ >
+ ::value
+ ));
+
+ BOOST_TEST((!tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_TemplateNotExist,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ >
+ ::value
+ ));
+
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
+ return boost::report_errors();
+
+ }
Added: sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParams.hpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParams.hpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,22 @@
+#if !defined(TEST_VM_MF_HAS_TEMPLATE_CHECK_PARAMS_HPP)
+#define TEST_VM_MF_HAS_TEMPLATE_CHECK_PARAMS_HPP
+
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
+#include "TestStructs.hpp"
+#include <boost/tti/TTIntrospectionVM.hpp>
+#include <boost/tti/TTIntrospection.hpp>
+
+TTI_VM_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(HT_Str,MStrMemberTemplate,class)
+TTI_VM_HAS_TEMPLATE_CHECK_PARAMS(AnotherMemberTemplate,int,int)
+TTI_VM_TRAIT_HAS_TEMPLATE_CHECK_PARAMS(WrongParametersForMP,ManyParameters,class,class,int,class,template <class> class InnerTemplate,class,short)
+TTI_VM_HAS_TEMPLATE_CHECK_PARAMS(CTManyParameters,class,class,int,short,class,template <class,int> class InnerTemplate,class)
+TTI_VM_HAS_TEMPLATE_CHECK_PARAMS(TemplateNotExist,int,class)
+
+TTI_MEMBER_TYPE(AStructType)
+TTI_TRAIT_MEMBER_TYPE(MT_BType,BType)
+TTI_MEMBER_TYPE(CType)
+
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
+#endif // TEST_VM_MF_HAS_TEMPLATE_CHECK_PARAMS_HPP
Added: sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsCompile.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsCompile.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,52 @@
+#include "TestVMMFHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
+ // You can always instantiate without compiler errors
+
+ tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_TemplateNotExist,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ > aVar;
+
+ // Compile time asserts
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::HT_Str,
+ tti::member_type_AStructType<AType>
+ >
+ ));
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_AnotherMemberTemplate,
+ boost::mpl::identity<AType>
+ >
+ ));
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_CTManyParameters,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ >
+ ));
+
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsFail.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsFail.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,26 @@
+#include "TestVMMFHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
+ // Template does not exist
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_TemplateNotExist,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ tti::MT_BType<AType>
+ >
+ >
+ ));
+
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsFail2.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsFail2.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,26 @@
+#include "TestVMMFHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
+ // Wrong enclosing type
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::has_template_check_params_CTManyParameters,
+ tti::mf_member_type
+ <
+ tti::member_type_CType,
+ boost::mpl::identity<AType>
+ >
+ >
+ ));
+
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
+ return 0;
+
+ }
Added: sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsFail3.cpp
==============================================================================
--- (empty file)
+++ sandbox/tti/libs/tti/test/TestVMMFHasTemplateCheckParamsFail3.cpp 2011-01-02 16:20:16 EST (Sun, 02 Jan 2011)
@@ -0,0 +1,22 @@
+#include "TestVMMFHasTemplateCheckParams.hpp"
+#include <boost/mpl/assert.hpp>
+
+int main()
+ {
+
+#if !defined(BOOST_NO_VARIADIC_MACROS)
+
+ // Wrong template types
+
+ BOOST_MPL_ASSERT((tti::mf_has_template_check_params
+ <
+ tti::WrongParametersForMP,
+ boost::mpl::identity<AnotherType>
+ >
+ ));
+
+#endif //!defined(BOOST_NO_VARIADIC_MACROS)
+
+ return 0;
+
+ }
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