Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67600 - in sandbox/tti: boost/tti libs/tti/doc libs/tti/test
From: eldiener_at_[hidden]
Date: 2011-01-02 19:02:15


Author: eldiener
Date: 2011-01-02 19:02:14 EST (Sun, 02 Jan 2011)
New Revision: 67600
URL: http://svn.boost.org/trac/boost/changeset/67600

Log:
Added metafunction and updated doc
Text files modified:
   sandbox/tti/boost/tti/TTIntrospection.hpp | 30 ++++++++++++++++++++++++++++++
   sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp | 5 ++---
   sandbox/tti/libs/tti/doc/TTIMetafunctions.qbk | 14 +++++++++++++-
   sandbox/tti/libs/tti/test/TestHasStaticMemberFail2.cpp | 2 +-
   4 files changed, 46 insertions(+), 5 deletions(-)

Modified: sandbox/tti/boost/tti/TTIntrospection.hpp
==============================================================================
--- sandbox/tti/boost/tti/TTIntrospection.hpp (original)
+++ sandbox/tti/boost/tti/TTIntrospection.hpp 2011-01-02 19:02:14 EST (Sun, 02 Jan 2011)
@@ -823,6 +823,36 @@
     {
     };
     
+/// A metafunction which checks whether a class template exists within an enclosing type.
+/**
+
+ This metafunction takes all its types as nullary metafunctions whose typedef 'type' member is the actual type used.
+
+ 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.
+
+ returns = 'value' is true if the template exists within the enclosing type,
+ otherwise 'value' is false.
+
+*/
+ template
+ <
+ template<class> class HasTemplate,
+ class T
+ >
+ struct mf_has_template :
+ tti::detail::eval
+ <
+ HasTemplate
+ <
+ T
+ >
+ >
+ {
+ };
+
 /// A metafunction which checks whether a member function exists within an enclosing type.
 /**
 

Modified: sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp
==============================================================================
--- sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp (original)
+++ sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp 2011-01-02 19:02:14 EST (Sun, 02 Jan 2011)
@@ -17,7 +17,7 @@
 namespace tti
   {
   
-/// A metafunction which checks whether a class template exists within an enclosing type.
+/// A metafunction which checks whether a class template with its parameters exists within an enclosing type.
 /**
 
     This metafunction takes all its types as nullary metafunctions whose typedef 'type' member is the actual type used.
@@ -42,8 +42,7 @@
       <
       HasTemplateCheckParams
         <
- T,
- boost::mpl::identity<boost::mpl::bool_< false > >
+ T
>
>
     {

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 19:02:14 EST (Sun, 02 Jan 2011)
@@ -57,8 +57,20 @@
     [TTI\_HAS\_TYPE\_CHECK\_TYPEDEF (TTI\_TRAIT\_HAS\_TYPE\_CHECK\_TYPEDEF)]
   ]
   [
+ [Class Template]
+ [tti::mf\_has\_template]
+ [
+ template<class> class HasTemplate[br]
+ = generated macro metafunction[br]
+ class T = enclosing type nullary metafunction
+ ]
+ [
+ TTI\_HAS\_TEMPLATE (TTI\_TRAIT\_HAS\_TEMPLATE)
+ ]
+ ]
+ [
     [Class Template with params]
- [tti::mf\_has\_template_check_params]
+ [tti::mf\_has\_template\_check\_params]
     [
     template<class> class HasTemplateCheckParams[br]
     = generated macro metafunction[br]

Modified: sandbox/tti/libs/tti/test/TestHasStaticMemberFail2.cpp
==============================================================================
--- sandbox/tti/libs/tti/test/TestHasStaticMemberFail2.cpp (original)
+++ sandbox/tti/libs/tti/test/TestHasStaticMemberFail2.cpp 2011-01-02 19:02:14 EST (Sun, 02 Jan 2011)
@@ -6,7 +6,7 @@
   
   // Wrong enclosing type for DSMember
   
- BOOST_MPL_ASSERT((AnotherType,short));
+ BOOST_MPL_ASSERT((tti::has_static_member_DSMember<AnotherType,short>));
   
   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