From 8ce982a0482878f099bc0822c112d2eeb4eff7eb Mon Sep 17 00:00:00 2001 From: Arkadiy Vertleyb Date: Tue, 25 Apr 2006 00:42:22 +0000 Subject: [PATCH] fix for VC PCH problem [SVN r33799] --- include/boost/typeof/encode_decode.hpp | 13 +- include/boost/typeof/encode_decode_params.hpp | 6 +- .../boost/typeof/integral_template_param.hpp | 4 +- include/boost/typeof/modifiers.hpp | 32 ++--- .../boost/typeof/pointers_data_members.hpp | 46 +++---- include/boost/typeof/register_functions.hpp | 2 +- .../typeof/register_functions_iterate.hpp | 119 +++++++++--------- .../boost/typeof/register_mem_functions.hpp | 2 +- include/boost/typeof/template_encoding.hpp | 6 +- .../boost/typeof/template_template_param.hpp | 28 ++--- include/boost/typeof/type_encoding.hpp | 8 +- include/boost/typeof/type_template_param.hpp | 4 +- 12 files changed, 132 insertions(+), 138 deletions(-) diff --git a/include/boost/typeof/encode_decode.hpp b/include/boost/typeof/encode_decode.hpp index 658fb77..03056be 100755 --- a/include/boost/typeof/encode_decode.hpp +++ b/include/boost/typeof/encode_decode.hpp @@ -8,7 +8,7 @@ #include #include -namespace boost { namespace type_of { namespace { + namespace { namespace boost_typeof { template struct encode_type_impl; @@ -18,17 +18,20 @@ namespace boost { namespace type_of { namespace { { typedef int type; // MSVC ETI workaround }; +}} - template - struct encode_type : encode_type_impl +namespace boost { namespace type_of { + + template + struct encode_type : boost_typeof::encode_type_impl {}; template - struct decode_type : decode_type_impl< + struct decode_type : boost_typeof::decode_type_impl< typename Iter::type, typename Iter::next > {}; -}}} +}} #endif//BOOST_TYPEOF_ENCODE_DECODE_HPP_INCLUDED diff --git a/include/boost/typeof/encode_decode_params.hpp b/include/boost/typeof/encode_decode_params.hpp index 1b019f6..fd9e59b 100755 --- a/include/boost/typeof/encode_decode_params.hpp +++ b/include/boost/typeof/encode_decode_params.hpp @@ -11,7 +11,7 @@ // Assumes iter0 contains initial iterator #define BOOST_TYPEOF_DECODE_PARAM(z, n, text) \ - typedef decode_type decode##n; \ + typedef boost::type_of::decode_type decode##n; \ typedef typename decode##n::type p##n; \ typedef typename decode##n::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n)); @@ -21,14 +21,14 @@ // The P0, P1, ... PN are encoded and added to V #define BOOST_TYPEOF_ENCODE_PARAMS_BEGIN(z, n, text)\ - typename encode_type< + typename boost::type_of::encode_type< #define BOOST_TYPEOF_ENCODE_PARAMS_END(z, n, text)\ , BOOST_PP_CAT(P, n)>::type #define BOOST_TYPEOF_ENCODE_PARAMS(n, ID) \ BOOST_PP_REPEAT(n, BOOST_TYPEOF_ENCODE_PARAMS_BEGIN, ~) \ - typename push_back >::type \ + typename boost::type_of::push_back >::type \ BOOST_PP_REPEAT(n, BOOST_TYPEOF_ENCODE_PARAMS_END, ~) #endif//BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED diff --git a/include/boost/typeof/integral_template_param.hpp b/include/boost/typeof/integral_template_param.hpp index 0a6e503..4e887df 100755 --- a/include/boost/typeof/integral_template_param.hpp +++ b/include/boost/typeof/integral_template_param.hpp @@ -55,14 +55,14 @@ // INTEGRAL_PARAM "virtual functions" implementation #define BOOST_TYPEOF_INTEGRAL_PARAM_ENCODE(This, n)\ - typedef typename encode_integral<\ + typedef typename boost::type_of::encode_integral<\ BOOST_PP_CAT(V, n),\ BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This),\ BOOST_PP_CAT(P, n)\ >::type BOOST_PP_CAT(V, BOOST_PP_INC(n)); #define BOOST_TYPEOF_INTEGRAL_PARAM_DECODE(This, n)\ - typedef decode_integral BOOST_PP_CAT(d, n);\ + typedef boost::type_of::decode_integral BOOST_PP_CAT(d, n);\ static const BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This) BOOST_PP_CAT(P, n) = BOOST_PP_CAT(d, n)::value;\ typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n)); diff --git a/include/boost/typeof/modifiers.hpp b/include/boost/typeof/modifiers.hpp index 2da88e4..2d3f96f 100755 --- a/include/boost/typeof/modifiers.hpp +++ b/include/boost/typeof/modifiers.hpp @@ -16,16 +16,16 @@ template struct encode_type_impl\ {\ typedef\ - typename encode_type<\ - typename push_back<\ + typename boost::type_of::encode_type<\ + typename boost::type_of::push_back<\ V\ - , mpl::size_t >::type\ + , boost::mpl::size_t >::type\ , T>::type\ type;\ };\ - template struct decode_type_impl, Iter>\ + template struct decode_type_impl, Iter>\ {\ - typedef decode_type d1;\ + typedef boost::type_of::decode_type d1;\ typedef Fun(typename d1::type) type;\ typedef typename d1::iter iter;\ } @@ -36,7 +36,7 @@ #define BOOST_TYPEOF_pointer_fun(T) T* #define BOOST_TYPEOF_reference_fun(T) T& -namespace boost { namespace type_of { namespace { +namespace { namespace boost_typeof { BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_const_fun); BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_volatile_fun); @@ -44,7 +44,7 @@ namespace boost { namespace type_of { namespace { BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_pointer_fun); BOOST_TYPEOF_modifier_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_TYPEOF_reference_fun); -}}} +}} #undef BOOST_TYPEOF_modifier_support #undef BOOST_TYPEOF_const_fun @@ -60,32 +60,32 @@ namespace boost { namespace type_of { namespace { struct encode_type_impl\ {\ typedef\ - typename encode_type<\ - typename push_back<\ - typename push_back<\ + typename boost::type_of::encode_type<\ + typename boost::type_of::push_back<\ + typename boost::type_of::push_back<\ V\ - , mpl::size_t >::type\ - , mpl::size_t >::type\ + , boost::mpl::size_t >::type\ + , boost::mpl::size_t >::type\ , T>::type\ type;\ };\ template\ - struct decode_type_impl, Iter>\ + struct decode_type_impl, Iter>\ {\ enum{n = Iter::type::value};\ - typedef decode_type d;\ + typedef boost::type_of::decode_type d;\ typedef typename d::type Qualifier() type[n];\ typedef typename d::iter iter;\ } -namespace boost { namespace type_of { namespace { +namespace { namespace boost_typeof { BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_EMPTY); BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(const)); BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(volatile)); BOOST_TYPEOF_array_support(BOOST_TYPEOF_UNIQUE_ID(), BOOST_PP_IDENTITY(volatile const)); -}}} +}} #undef BOOST_TYPEOF_array_support diff --git a/include/boost/typeof/pointers_data_members.hpp b/include/boost/typeof/pointers_data_members.hpp index ca6f349..a821425 100755 --- a/include/boost/typeof/pointers_data_members.hpp +++ b/include/boost/typeof/pointers_data_members.hpp @@ -10,35 +10,29 @@ #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() -namespace boost -{ - namespace type_of +namespace { namespace boost_typeof { + + enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()}; + + template + struct encode_type_impl { - namespace - { - enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()}; + typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type; + }; - template - struct encode_type_impl - { - typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type; - }; + template + struct decode_type_impl, Iter> + { + typedef Iter iter0; + BOOST_TYPEOF_DECODE_PARAMS(2) - template - struct decode_type_impl, Iter> - { - typedef Iter iter0; - BOOST_TYPEOF_DECODE_PARAMS(2) + template struct workaround{ + typedef p0 T::* type; + }; - template struct workaround{ - typedef p0 T::* type; - }; - - typedef typename workaround::type type; - typedef iter2 iter; - }; - } - } -} + typedef typename workaround::type type; + typedef iter2 iter; + }; +}} #endif//BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED diff --git a/include/boost/typeof/register_functions.hpp b/include/boost/typeof/register_functions.hpp index fc53bfe..f7badb5 100755 --- a/include/boost/typeof/register_functions.hpp +++ b/include/boost/typeof/register_functions.hpp @@ -32,7 +32,7 @@ enum VOLATILE_CONST_MEM_FUN_ID = FUN_ID + 6 * BOOST_PP_INC(BOOST_TYPEOF_LIMIT_FUNCTION_ARITY) }; -namespace boost { namespace type_of { +namespace { namespace boost_typeof { # define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPEOF_LIMIT_FUNCTION_ARITY) # define BOOST_PP_FILENAME_1 diff --git a/include/boost/typeof/register_functions_iterate.hpp b/include/boost/typeof/register_functions_iterate.hpp index 9aaea51..f381b5d 100755 --- a/include/boost/typeof/register_functions_iterate.hpp +++ b/include/boost/typeof/register_functions_iterate.hpp @@ -6,83 +6,80 @@ #define n BOOST_PP_ITERATION() -namespace +// function pointers + +template +struct encode_type_impl { - // function pointers + typedef R BOOST_PP_CAT(P, n); + typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type; +}; - template - struct encode_type_impl - { - typedef R BOOST_PP_CAT(P, n); - typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type; - }; - - template - struct decode_type_impl, Iter> - { - typedef Iter iter0; - BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n)) - typedef BOOST_PP_CAT(p, n)(*type)(BOOST_PP_ENUM_PARAMS(n, p)); - typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter; - }; +template +struct decode_type_impl, Iter> +{ + typedef Iter iter0; + BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n)) + typedef BOOST_PP_CAT(p, n)(*type)(BOOST_PP_ENUM_PARAMS(n, p)); + typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter; +}; #ifndef BOOST_TYPEOF_NO_FUNCTION_TYPES - // function references + // function references - template - struct encode_type_impl - { - typedef R BOOST_PP_CAT(P, n); - typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_REF_ID + n) type; - }; + template + struct encode_type_impl + { + typedef R BOOST_PP_CAT(P, n); + typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_REF_ID + n) type; + }; - template - struct decode_type_impl, Iter> - { - typedef Iter iter0; - BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n)) - typedef BOOST_PP_CAT(p, n)(&type)(BOOST_PP_ENUM_PARAMS(n, p)); - typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter; - }; + template + struct decode_type_impl, Iter> + { + typedef Iter iter0; + BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n)) + typedef BOOST_PP_CAT(p, n)(&type)(BOOST_PP_ENUM_PARAMS(n, p)); + typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter; + }; - // functions + // functions - template - struct encode_type_impl - { - typedef R BOOST_PP_CAT(P, n); - typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_ID + n) type; - }; + template + struct encode_type_impl + { + typedef R BOOST_PP_CAT(P, n); + typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_ID + n) type; + }; - template - struct decode_type_impl, Iter> - { - typedef Iter iter0; - BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n)) - typedef BOOST_PP_CAT(p, n)(type)(BOOST_PP_ENUM_PARAMS(n, p)); - typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter; - }; + template + struct decode_type_impl, Iter> + { + typedef Iter iter0; + BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_INC(n)) + typedef BOOST_PP_CAT(p, n)(type)(BOOST_PP_ENUM_PARAMS(n, p)); + typedef BOOST_PP_CAT(iter, BOOST_PP_INC(n)) iter; + }; #endif//BOOST_TYPEOF_NO_FUNCTION_TYPES - // member functions +// member functions - #define BOOST_TYPEOF_qualifier - #define BOOST_TYPEOF_id MEM_FUN_ID - #include +#define BOOST_TYPEOF_qualifier +#define BOOST_TYPEOF_id MEM_FUN_ID +#include - #define BOOST_TYPEOF_qualifier const - #define BOOST_TYPEOF_id CONST_MEM_FUN_ID - #include +#define BOOST_TYPEOF_qualifier const +#define BOOST_TYPEOF_id CONST_MEM_FUN_ID +#include - #define BOOST_TYPEOF_qualifier volatile - #define BOOST_TYPEOF_id VOLATILE_MEM_FUN_ID - #include +#define BOOST_TYPEOF_qualifier volatile +#define BOOST_TYPEOF_id VOLATILE_MEM_FUN_ID +#include - #define BOOST_TYPEOF_qualifier volatile const - #define BOOST_TYPEOF_id VOLATILE_CONST_MEM_FUN_ID - #include -} +#define BOOST_TYPEOF_qualifier volatile const +#define BOOST_TYPEOF_id VOLATILE_CONST_MEM_FUN_ID +#include #undef n diff --git a/include/boost/typeof/register_mem_functions.hpp b/include/boost/typeof/register_mem_functions.hpp index 0959303..9cf9720 100755 --- a/include/boost/typeof/register_mem_functions.hpp +++ b/include/boost/typeof/register_mem_functions.hpp @@ -15,7 +15,7 @@ struct encode_type_impl -struct decode_type_impl, Iter> +struct decode_type_impl, Iter> { typedef Iter iter0; BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_ADD(n, 2)) diff --git a/include/boost/typeof/template_encoding.hpp b/include/boost/typeof/template_encoding.hpp index 00306ae..5de7732 100755 --- a/include/boost/typeof/template_encoding.hpp +++ b/include/boost/typeof/template_encoding.hpp @@ -128,14 +128,14 @@ BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TYPE)(Name,Params) #define BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(Name, Params, Size, ID)\ - namespace boost { namespace type_of { namespace {\ + namespace { namespace boost_typeof {\ BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name, Params, ID)\ template\ struct encode_type_impl >\ {\ - typedef typename push_back >::type V0;\ + typedef typename boost::type_of::push_back >::type V0;\ BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_ENCODE_PARAM, ~, Params)\ typedef BOOST_PP_CAT(V, Size) type;\ };\ @@ -147,6 +147,6 @@ BOOST_TYPEOF_TYPEDEF_DECODED_TYPE(Name, Params)\ typedef BOOST_PP_CAT(iter, Size) iter;\ };\ - }}} + }} #endif//BOOST_TYPEOF_TEMPLATE_ENCODING_HPP_INCLUDED diff --git a/include/boost/typeof/template_template_param.hpp b/include/boost/typeof/template_template_param.hpp index 188414f..468d487 100755 --- a/include/boost/typeof/template_template_param.hpp +++ b/include/boost/typeof/template_template_param.hpp @@ -23,12 +23,12 @@ //Encode / decode this #define BOOST_TYPEOF_TEMPLATE_PARAM_ENCODE(This, n)\ - typedef typename encode_template\ >::type BOOST_PP_CAT(V, BOOST_PP_INC(n)); #define BOOST_TYPEOF_TEMPLATE_PARAM_DECODE(This, n)\ - typedef decode_template< BOOST_PP_CAT(iter, n) > BOOST_PP_CAT(d, n);\ + typedef boost::type_of::decode_template< BOOST_PP_CAT(iter, n) > BOOST_PP_CAT(d, n);\ typedef typename BOOST_PP_CAT(d, n)::type BOOST_PP_CAT(P, n);\ typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter,BOOST_PP_INC(n)); @@ -51,22 +51,22 @@ //////////////////////////// // move to encode_decode? +namespace { namespace boost_typeof { + + template struct encode_template_impl; + template struct decode_template_impl; + +}} + namespace boost { namespace type_of { - namespace - { - template struct encode_template_impl; - template struct decode_template_impl; - } - - template struct encode_template - : encode_template_impl + template struct encode_template + : boost_typeof::encode_template_impl {}; template struct decode_template - : decode_template_impl + : boost_typeof::decode_template_impl {}; - }} //////////////////////////// @@ -81,10 +81,10 @@ namespace boost { namespace type_of { BOOST_PP_ENUM_PARAMS(\ BOOST_PP_SEQ_SIZE(Params),\ P)> >\ - : push_back >\ + : boost::type_of::push_back >\ {\ };\ - template struct decode_template_impl, Iter>\ + template struct decode_template_impl, Iter>\ {\ BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(Params),BOOST_TYPEOF_TYPEDEF_INT_PN,_)\ typedef Name type;\ diff --git a/include/boost/typeof/type_encoding.hpp b/include/boost/typeof/type_encoding.hpp index 33195ce..281f529 100755 --- a/include/boost/typeof/type_encoding.hpp +++ b/include/boost/typeof/type_encoding.hpp @@ -8,18 +8,18 @@ #define BOOST_TYPEOF_REGISTER_TYPE_IMPL(T, Id) \ \ template struct encode_type_impl \ - : push_back > \ + : boost::type_of::push_back > \ {}; \ - template struct decode_type_impl, Iter> \ + template struct decode_type_impl, Iter> \ { \ typedef T type; \ typedef Iter iter; \ }; #define BOOST_TYPEOF_REGISTER_TYPE_EXPLICIT_ID(Type, Id) \ - namespace boost { namespace type_of { namespace { \ + namespace { namespace boost_typeof { \ BOOST_TYPEOF_REGISTER_TYPE_IMPL(Type, Id) \ - }}} + }} #define BOOST_TYPEOF_REGISTER_TYPE(Type) \ BOOST_TYPEOF_REGISTER_TYPE_EXPLICIT_ID(Type, BOOST_TYPEOF_UNIQUE_ID()) diff --git a/include/boost/typeof/type_template_param.hpp b/include/boost/typeof/type_template_param.hpp index 34e063c..d0bb77f 100755 --- a/include/boost/typeof/type_template_param.hpp +++ b/include/boost/typeof/type_template_param.hpp @@ -19,13 +19,13 @@ // TYPE_PARAM "virtual functions" implementation #define BOOST_TYPEOF_TYPE_PARAM_ENCODE(This, n)\ - typedef typename encode_type<\ + typedef typename boost::type_of::encode_type<\ BOOST_PP_CAT(V, n),\ BOOST_PP_CAT(P, n)\ >::type BOOST_PP_CAT(V, BOOST_PP_INC(n)); #define BOOST_TYPEOF_TYPE_PARAM_DECODE(This, n)\ - typedef decode_type< BOOST_PP_CAT(iter, n) > BOOST_PP_CAT(d, n);\ + typedef boost::type_of::decode_type< BOOST_PP_CAT(iter, n) > BOOST_PP_CAT(d, n);\ typedef typename BOOST_PP_CAT(d, n)::type BOOST_PP_CAT(P, n);\ typedef typename BOOST_PP_CAT(d, n)::iter BOOST_PP_CAT(iter, BOOST_PP_INC(n));