Boost logo

Boost-Commit :

From: peder.holt_at_[hidden]
Date: 2007-10-05 08:39:25


Author: burbelgruff
Date: 2007-10-05 08:39:15 EDT (Fri, 05 Oct 2007)
New Revision: 39704
URL: http://svn.boost.org/trac/boost/changeset/39704

Log:
typeof support for template template arguments for Borland 5.9.2 (also used for Borland 5.8.2) (reverted to old scheme for other compilers)
Text files modified:
   trunk/boost/typeof/template_template_param.hpp | 29 ++++++++++++++++++++++++-----
   1 files changed, 24 insertions(+), 5 deletions(-)

Modified: trunk/boost/typeof/template_template_param.hpp
==============================================================================
--- trunk/boost/typeof/template_template_param.hpp (original)
+++ trunk/boost/typeof/template_template_param.hpp 2007-10-05 08:39:15 EDT (Fri, 05 Oct 2007)
@@ -93,10 +93,17 @@
 
 #define BOOST_TYPEOF_TYPEDEF_INT_PN(z,n,Params) typedef int BOOST_PP_CAT(P,n);
 
+#ifdef __BORLANDC__
+#define BOOST_TYPEOF_DECODE_NESTED_TEMPLATE_HELPER_NAME BOOST_PP_CAT(\
+ BOOST_PP_CAT(\
+ BOOST_PP_CAT(\
+ decode_nested_template_helper,\
+ BOOST_TYPEOF_REGISTRATION_GROUP\
+ ),0x10000\
+ ),__LINE__\
+ )
 #define BOOST_TYPEOF_REGISTER_DECODE_NESTED_TEMPLATE_HELPER_IMPL(Name,Params,ID)\
- template<>\
- struct decode_nested_template_helper_impl<boost::mpl::size_t<ID> >\
- {\
+ struct BOOST_TYPEOF_DECODE_NESTED_TEMPLATE_HELPER_NAME {\
         template<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_REGISTER_DECLARE_DECODER_TYPE_PARAM_PAIR) >\
         struct decode_params;\
         template<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_REGISTER_DECODER_TYPE_PARAM_PAIR) >\
@@ -105,12 +112,24 @@
             typedef Name<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),T)> type;\
         };\
     };
+//Template template param decoding
+#define BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TEMPLATE_TYPE(Name,Params)\
+ typedef typename BOOST_TYPEOF_DECODE_NESTED_TEMPLATE_HELPER_NAME::decode_params<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),P)>::type type;
 
+#else
+#define BOOST_TYPEOF_REGISTER_DECODE_NESTED_TEMPLATE_HELPER_IMPL(Name,Params,ID)
 
 //Template template param decoding
 #define BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TEMPLATE_TYPE(Name,Params)\
- typedef typename decode_nested_template_helper_impl<self_id>::template decode_params<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),P)>::type type;
-
+ template<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_REGISTER_DECLARE_DECODER_TYPE_PARAM_PAIR) >\
+ struct decode_params;\
+ template<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_REGISTER_DECODER_TYPE_PARAM_PAIR) >\
+ struct decode_params<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_PLACEHOLDER_TYPES) >\
+ {\
+ typedef Name<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),T)> type;\
+ };\
+ typedef typename decode_params<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),P)>::type type;
+#endif
 #define BOOST_TYPEOF_REGISTER_DECLARE_DECODER_TYPE_PARAM_PAIR(z,n,elem) \
     BOOST_TYPEOF_VIRTUAL(DECLARATION_TYPE, elem)(elem) BOOST_PP_CAT(T, n)
 


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