fix for VC PCH problem

[SVN r33799]
This commit is contained in:
Arkadiy Vertleyb
2006-04-25 00:42:22 +00:00
parent 9bc7ac4b43
commit 8ce982a048
12 changed files with 132 additions and 138 deletions

View File

@ -8,7 +8,7 @@
#include <boost/mpl/deref.hpp>
#include <boost/mpl/next.hpp>
namespace boost { namespace type_of { namespace {
namespace { namespace boost_typeof {
template<class V, class Type_Not_Registered_With_Typeof_System>
struct encode_type_impl;
@ -18,17 +18,20 @@ namespace boost { namespace type_of { namespace {
{
typedef int type; // MSVC ETI workaround
};
}}
template<class V, class T>
struct encode_type : encode_type_impl<V, T>
namespace boost { namespace type_of {
template<class V, class T>
struct encode_type : boost_typeof::encode_type_impl<V, T>
{};
template<class Iter>
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

View File

@ -11,7 +11,7 @@
// Assumes iter0 contains initial iterator
#define BOOST_TYPEOF_DECODE_PARAM(z, n, text) \
typedef decode_type<iter##n> decode##n; \
typedef boost::type_of::decode_type<iter##n> 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<V, mpl::size_t<ID> >::type \
typename boost::type_of::push_back<V, boost::mpl::size_t<ID> >::type \
BOOST_PP_REPEAT(n, BOOST_TYPEOF_ENCODE_PARAMS_END, ~)
#endif//BOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED

View File

@ -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_TYPEOF_INTEGRAL_PARAM_GETTYPE(This), BOOST_PP_CAT(iter, n)> BOOST_PP_CAT(d, n);\
typedef boost::type_of::decode_integral<BOOST_TYPEOF_INTEGRAL_PARAM_GETTYPE(This), BOOST_PP_CAT(iter, n)> 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));

View File

@ -16,16 +16,16 @@
template<class V, class T> struct encode_type_impl<V, Fun(T)>\
{\
typedef\
typename encode_type<\
typename push_back<\
typename boost::type_of::encode_type<\
typename boost::type_of::push_back<\
V\
, mpl::size_t<ID> >::type\
, boost::mpl::size_t<ID> >::type\
, T>::type\
type;\
};\
template<class Iter> struct decode_type_impl<mpl::size_t<ID>, Iter>\
template<class Iter> struct decode_type_impl<boost::mpl::size_t<ID>, Iter>\
{\
typedef decode_type<Iter> d1;\
typedef boost::type_of::decode_type<Iter> 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<V, Qualifier() T[N]>\
{\
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<ID> >::type\
, mpl::size_t<N> >::type\
, boost::mpl::size_t<ID> >::type\
, boost::mpl::size_t<N> >::type\
, T>::type\
type;\
};\
template<class Iter>\
struct decode_type_impl<mpl::size_t<ID>, Iter>\
struct decode_type_impl<boost::mpl::size_t<ID>, Iter>\
{\
enum{n = Iter::type::value};\
typedef decode_type<typename Iter::next> d;\
typedef boost::type_of::decode_type<typename Iter::next> 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

View File

@ -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<class V, class P0, class P1>
struct encode_type_impl<V, P0 P1::*>
{
namespace
{
enum {PTR_DATA_MEM_ID = BOOST_TYPEOF_UNIQUE_ID()};
typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type;
};
template<class V, class P0, class P1>
struct encode_type_impl<V, P0 P1::*>
{
typedef BOOST_TYPEOF_ENCODE_PARAMS(2, PTR_DATA_MEM_ID) type;
};
template<class Iter>
struct decode_type_impl<boost::mpl::size_t<PTR_DATA_MEM_ID>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(2)
template<class Iter>
struct decode_type_impl<mpl::size_t<PTR_DATA_MEM_ID>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(2)
template<class T> struct workaround{
typedef p0 T::* type;
};
template<class T> struct workaround{
typedef p0 T::* type;
};
typedef typename workaround<p1>::type type;
typedef iter2 iter;
};
}
}
}
typedef typename workaround<p1>::type type;
typedef iter2 iter;
};
}}
#endif//BOOST_TYPEOF_POINTERS_DATA_MEMBERS_HPP_INCLUDED

View File

@ -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 <boost/typeof/register_functions_iterate.hpp>

View File

@ -6,83 +6,80 @@
#define n BOOST_PP_ITERATION()
namespace
// function pointers
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(*)(BOOST_PP_ENUM_PARAMS(n, P))>
{
// function pointers
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type;
};
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(*)(BOOST_PP_ENUM_PARAMS(n, P))>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_PTR_ID + n) type;
};
template<class Iter>
struct decode_type_impl<mpl::size_t<FUN_PTR_ID + n>, 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<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_PTR_ID + n>, 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<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(&)(BOOST_PP_ENUM_PARAMS(n, P))>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_REF_ID + n) type;
};
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(&)(BOOST_PP_ENUM_PARAMS(n, P))>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_REF_ID + n) type;
};
template<class Iter>
struct decode_type_impl<mpl::size_t<FUN_REF_ID + n>, 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<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_REF_ID + n>, 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<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(BOOST_PP_ENUM_PARAMS(n, P))>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_ID + n) type;
};
template<class V, class R BOOST_PP_ENUM_TRAILING_PARAMS(n, class P)>
struct encode_type_impl<V, R(BOOST_PP_ENUM_PARAMS(n, P))>
{
typedef R BOOST_PP_CAT(P, n);
typedef BOOST_TYPEOF_ENCODE_PARAMS(BOOST_PP_INC(n), FUN_ID + n) type;
};
template<class Iter>
struct decode_type_impl<mpl::size_t<FUN_ID + n>, 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<class Iter>
struct decode_type_impl<boost::mpl::size_t<FUN_ID + n>, 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 <boost/typeof/register_mem_functions.hpp>
#define BOOST_TYPEOF_qualifier
#define BOOST_TYPEOF_id MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
#define BOOST_TYPEOF_qualifier const
#define BOOST_TYPEOF_id CONST_MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
#define BOOST_TYPEOF_qualifier const
#define BOOST_TYPEOF_id CONST_MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
#define BOOST_TYPEOF_qualifier volatile
#define BOOST_TYPEOF_id VOLATILE_MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
#define BOOST_TYPEOF_qualifier volatile
#define BOOST_TYPEOF_id VOLATILE_MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
#define BOOST_TYPEOF_qualifier volatile const
#define BOOST_TYPEOF_id VOLATILE_CONST_MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
}
#define BOOST_TYPEOF_qualifier volatile const
#define BOOST_TYPEOF_id VOLATILE_CONST_MEM_FUN_ID
#include <boost/typeof/register_mem_functions.hpp>
#undef n

View File

@ -15,7 +15,7 @@ struct encode_type_impl<V, R(T::*)(BOOST_PP_ENUM_PARAMS(n, P)) BOOST_TYPEOF_qual
};
template<class Iter>
struct decode_type_impl<mpl::size_t<BOOST_TYPEOF_id + n>, Iter>
struct decode_type_impl<boost::mpl::size_t<BOOST_TYPEOF_id + n>, Iter>
{
typedef Iter iter0;
BOOST_TYPEOF_DECODE_PARAMS(BOOST_PP_ADD(n, 2))

View File

@ -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<class V\
BOOST_TYPEOF_SEQ_ENUM_TRAILING(Params, BOOST_TYPEOF_REGISTER_TEMPLATE_PARAM_PAIR)\
>\
struct encode_type_impl<V, Name<BOOST_PP_ENUM_PARAMS(Size, P)> >\
{\
typedef typename push_back<V, boost::mpl::size_t<ID> >::type V0;\
typedef typename boost::type_of::push_back<V, boost::mpl::size_t<ID> >::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

View File

@ -23,12 +23,12 @@
//Encode / decode this
#define BOOST_TYPEOF_TEMPLATE_PARAM_ENCODE(This, n)\
typedef typename encode_template<BOOST_PP_CAT(V, n),\
typedef typename boost::type_of::encode_template<BOOST_PP_CAT(V, n),\
BOOST_PP_CAT(P, n)<BOOST_TYPEOF_SEQ_ENUM(BOOST_TYPEOF_MAKE_OBJS(BOOST_TYPEOF_TEMPLATE_PARAM_GETPARAMS(This)),BOOST_TYPEOF_PLACEHOLDER) >\
>::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<class V, class Type_Not_Registered_With_Typeof_System> struct encode_template_impl;
template<class T, class Iter> struct decode_template_impl;
}}
namespace boost { namespace type_of {
namespace
{
template<class V, class Type_Not_Registered_With_Typeof_System> struct encode_template_impl;
template<class T, class Iter> struct decode_template_impl;
}
template<class V, class T> struct encode_template
: encode_template_impl<V, T>
template<class V, class T> struct encode_template
: boost_typeof::encode_template_impl<V, T>
{};
template<class Iter> struct decode_template
: decode_template_impl<typename Iter::type, typename Iter::next>
: boost_typeof::decode_template_impl<typename Iter::type, typename Iter::next>
{};
}}
////////////////////////////
@ -81,10 +81,10 @@ namespace boost { namespace type_of {
BOOST_PP_ENUM_PARAMS(\
BOOST_PP_SEQ_SIZE(Params),\
P)> >\
: push_back<V, mpl::size_t<ID> >\
: boost::type_of::push_back<V, boost::mpl::size_t<ID> >\
{\
};\
template<class Iter> struct decode_template_impl<mpl::size_t<ID>, Iter>\
template<class Iter> struct decode_template_impl<boost::mpl::size_t<ID>, Iter>\
{\
BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(Params),BOOST_TYPEOF_TYPEDEF_INT_PN,_)\
typedef Name<BOOST_TYPEOF_SEQ_ENUM(Params,BOOST_TYPEOF_PLACEHOLDER) > type;\

View File

@ -8,18 +8,18 @@
#define BOOST_TYPEOF_REGISTER_TYPE_IMPL(T, Id) \
\
template<class V> struct encode_type_impl<V, T > \
: push_back<V, mpl::size_t<Id> > \
: boost::type_of::push_back<V, boost::mpl::size_t<Id> > \
{}; \
template<class Iter> struct decode_type_impl<mpl::size_t<Id>, Iter> \
template<class Iter> struct decode_type_impl<boost::mpl::size_t<Id>, 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())

View File

@ -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));