Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68208 - in sandbox/tti: boost/tti boost/tti/detail libs/tti/test
From: eldiener_at_[hidden]
Date: 2011-01-17 14:21:25


Author: eldiener
Date: 2011-01-17 14:21:24 EST (Mon, 17 Jan 2011)
New Revision: 68208
URL: http://svn.boost.org/trac/boost/changeset/68208

Log:
Fixes for gcc3
Added:
   sandbox/tti/boost/tti/detail/TTIntrospectionIterateEvalGcc3.hpp (contents, props changed)
Text files modified:
   sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp | 40 +++++++++++++++++++++++++++++++++++++++-
   sandbox/tti/boost/tti/detail/TTIntrospectionDetail.hpp | 21 ++++++++++++++++++---
   sandbox/tti/libs/tti/test/Jamfile.v2 | 4 +++-
   3 files changed, 60 insertions(+), 5 deletions(-)

Modified: sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp
==============================================================================
--- sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp (original)
+++ sandbox/tti/boost/tti/TTIntrospectionTemplate.hpp 2011-01-17 14:21:24 EST (Mon, 17 Jan 2011)
@@ -17,6 +17,8 @@
 namespace tti
   {
   
+#if !defined(TTI_GNUC3)
+
 /// A metafunction which checks whether a class template with its parameters exists within an enclosing type.
 /**
 
@@ -34,7 +36,7 @@
 */
   template
     <
- template<class,class = boost::mpl::bool_< false > > class HasTemplateCheckParams,
+ template<class,class = boost::mpl::false_> class HasTemplateCheckParams,
     class T
>
   struct mf_has_template_check_params :
@@ -48,6 +50,42 @@
     {
     };
     
+#else
+
+/// 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.
+
+ The metafunction types and return:
+
+ 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,
+ otherwise 'value' is false.
+
+*/
+ template
+ <
+ template<class,class = boost::mpl::false_> class HasTemplateCheckParams,
+ class T
+ >
+ struct mf_has_template_check_params :
+ tti::detail::eval_gcc3
+ <
+ HasTemplateCheckParams
+ <
+ T
+ >,
+ 1
+ >
+ {
+ };
+
+#endif
+
   }
   
 #endif // TT_INTROSPECTION_TEMPLATE_HPP

Modified: sandbox/tti/boost/tti/detail/TTIntrospectionDetail.hpp
==============================================================================
--- sandbox/tti/boost/tti/detail/TTIntrospectionDetail.hpp (original)
+++ sandbox/tti/boost/tti/detail/TTIntrospectionDetail.hpp 2011-01-17 14:21:24 EST (Mon, 17 Jan 2011)
@@ -19,7 +19,6 @@
 #include <boost/preprocessor/repetition/enum_shifted.hpp>
 #include <boost/preprocessor/repetition/enum_shifted_params.hpp>
 #include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
 #include <boost/function_types/member_function_pointer.hpp>
 #include <boost/function_types/function_type.hpp>
 #include <boost/type_traits/is_same.hpp>
@@ -225,6 +224,10 @@
 #define TTI_MAX_PARAMETERS 10
 #endif
 
+#if defined(__GNUC__) && __GNUC__ == 3
+#define TTI_GNUC3 1
+#endif
+
 namespace tti
   {
   namespace detail
@@ -244,11 +247,22 @@
 #define BOOST_PP_FILENAME_1 <boost\tti\detail\TTIntrospectionIterateEval.hpp>
 #include BOOST_PP_ITERATE()
 
+#if defined(TTI_GNUC3)
+
+ template<class T,int N>
+ struct eval_gcc3;
+
+#define BOOST_PP_ITERATION_LIMITS (1,BOOST_PP_ADD(2,TTI_MAX_PARAMETERS))
+#define BOOST_PP_FILENAME_1 <boost\tti\detail\TTIntrospectionIterateEvalGcc3.hpp>
+#include BOOST_PP_ITERATE()
+
+#endif
+
     template
       <
       class T,
       class R,
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(TTI_MAX_PARAMETERS,class P,tti::detail::noparam)
+ BOOST_PP_ENUM_PARAMS(TTI_MAX_PARAMETERS,class P)
>
     struct ptmf
       {
@@ -270,7 +284,7 @@
     template
       <
       class R,
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(TTI_MAX_PARAMETERS,class P,tti::detail::noparam)
+ BOOST_PP_ENUM_PARAMS(TTI_MAX_PARAMETERS,class P)
>
     struct tfunction
       {
@@ -294,6 +308,7 @@
>
       {
       };
+
     }
   }
   

Added: sandbox/tti/boost/tti/detail/TTIntrospectionIterateEvalGcc3.hpp
==============================================================================
--- (empty file)
+++ sandbox/tti/boost/tti/detail/TTIntrospectionIterateEvalGcc3.hpp 2011-01-17 14:21:24 EST (Mon, 17 Jan 2011)
@@ -0,0 +1,15 @@
+ template
+ <
+ template
+ <
+ BOOST_PP_REPEAT(BOOST_PP_ITERATION(),TTI_DETAIL_PP_REPEAT_CLASS,class)
+ >
+ class F,
+ BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ADD(1,BOOST_PP_ITERATION()),class P)
+ >
+ struct eval_gcc3<F<BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_ADD(1,BOOST_PP_ITERATION()),P)>,BOOST_PP_ITERATION() > :
+ F
+ <
+ BOOST_PP_ENUM_SHIFTED(BOOST_PP_ADD(1,BOOST_PP_ITERATION()),TTI_DETAIL_PP_ENUM_SHIFTED_TYPENAME,pdata)
+ >
+ {};

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-17 14:21:24 EST (Mon, 17 Jan 2011)
@@ -10,10 +10,12 @@
                                  <toolset>gcc-4.3.0:<warnings>all
                                  <toolset>gcc-4.3.0:<cxxflags>-Wno-variadic-macros
                                  <toolset>gcc-4.4.0:<warnings>all
- <toolset>gcc-4.4.0:<cxxflags>-Wno-variadic-macros
+ <toolset>gcc-4.4.0:<cxxflags>-Wno-variadic-macros
                                  <toolset>gcc-4.5.0:<warnings>all
                                  <toolset>gcc-4.5.0:<cxxflags>-Wno-variadic-macros
                                  <toolset>gcc-4.5.0:<linkflags>"-Wl,--enable-auto-import"
+ <toolset>gcc-4.5.2:<warnings>all
+ <toolset>gcc-4.5.2:<cxxflags>-Wno-variadic-macros
                                  <toolset>msvc:<warnings>all
                                  ;
 


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