From 86d4e1c4db244d0eafb2c393c8ca85d37f387e72 Mon Sep 17 00:00:00 2001 From: Peder Holt Date: Fri, 5 Oct 2007 12:39:15 +0000 Subject: [PATCH] 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) [SVN r39704] --- .../boost/typeof/template_template_param.hpp | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/include/boost/typeof/template_template_param.hpp b/include/boost/typeof/template_template_param.hpp index 48f5c88..4d64190 100755 --- a/include/boost/typeof/template_template_param.hpp +++ b/include/boost/typeof/template_template_param.hpp @@ -93,10 +93,17 @@ namespace boost { namespace type_of { #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 >\ - {\ + struct BOOST_TYPEOF_DECODE_NESTED_TEMPLATE_HELPER_NAME {\ template\ struct decode_params;\ template\ @@ -105,12 +112,24 @@ namespace boost { namespace type_of { typedef Name 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::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::template decode_params::type type; - + template\ + struct decode_params;\ + template\ + struct decode_params\ + {\ + typedef Name type;\ + };\ + typedef typename decode_params::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)