mirror of
https://github.com/boostorg/typeof.git
synced 2025-07-30 12:57:29 +02:00
removed TEMPLATE_X
[SVN r2498]
This commit is contained in:
@ -33,7 +33,7 @@ string name2path(const string& name, const string& ext)
|
||||
string copyright(const string& master)
|
||||
{
|
||||
return
|
||||
"// Copyright (C) 2004 " + master + ".\n"
|
||||
"// Copyright (C) 2005 " + master + ".\n"
|
||||
"// Use, modification and distribution is subject to the Boost Software\n"
|
||||
"// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)\n\n"
|
||||
"// This is a generated file -- please do not modify by hand."
|
||||
@ -114,7 +114,7 @@ public:
|
||||
else if (what == "TEMPLATE_X")
|
||||
{
|
||||
string params = getTokenAt<string>(tokens, 2);
|
||||
m_out << "BOOST_TYPEOF_REGISTER_TEMPLATE_X(" << name << ", " << params << ")" << endl;
|
||||
m_out << "BOOST_TYPEOF_REGISTER_TEMPLATE(" << name << ", " << params << ")" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -31,7 +31,7 @@
|
||||
#define BOOST_TYPEOF_INTEGRAL_PARAM_PLACEHOLDER_TYPES(Param, n)\
|
||||
BOOST_PP_CAT(T,n)
|
||||
|
||||
#define BOOST_TYPEOF_INTEGRAL_PARAM_TT_CATEGORY 1
|
||||
#define BOOST_TYPEOF_INTEGRAL_PARAM_ISTEMPLATE 0
|
||||
|
||||
|
||||
#endif//BOOST_TYPEOF_COMPLIANT_INTEGRAL_TEMPLATE_PARAM_HPP_INCLUDED
|
||||
|
@ -45,11 +45,12 @@
|
||||
|
||||
//Branch the decoding
|
||||
#define BOOST_TYPEOF_TYPEDEF_DECODED_TYPE(Name,Params)\
|
||||
BOOST_PP_IF(BOOST_TYPEOF_HAS_TEMPLATE_TEMPLATE_ARGUMENTS(Params),\
|
||||
BOOST_PP_IF(BOOST_TYPEOF_HAS_TEMPLATES(Params),\
|
||||
BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TEMPLATE_TYPE,\
|
||||
BOOST_TYPEOF_TYPEDEF_DECODED_TEMPLATE_TYPE)(Name,Params)
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_X_IMPL(Name, Params, Size, ID)\
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(Name, Params, Size, ID)\
|
||||
namespace boost{namespace type_of{namespace{\
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name, Params, ID)\
|
||||
template<class V\
|
||||
BOOST_TYPEOF_SEQ_ENUM_TRAILING(Params, BOOST_TYPEOF_REGISTER_TEMPLATE_PARAM_PAIR)\
|
||||
@ -67,21 +68,7 @@
|
||||
BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_DECODE_PARAM, ~, Params)\
|
||||
BOOST_TYPEOF_TYPEDEF_DECODED_TYPE(Name, Params)\
|
||||
typedef BOOST_PP_CAT(iter, Size) iter;\
|
||||
};
|
||||
|
||||
#define BOOST_TYPEOF_OBJECT_MAKER(s, data, elem)\
|
||||
BOOST_TYPEOF_MAKE_OBJ(elem)
|
||||
|
||||
#define BOOST_TYPEOF_TRANSFORM_PARAMS(Params)\
|
||||
BOOST_PP_SEQ_TRANSFORM(BOOST_TYPEOF_OBJECT_MAKER, ~, Params)
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_X(Name, Params)\
|
||||
namespace boost{namespace type_of{namespace{\
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X_IMPL(\
|
||||
Name,\
|
||||
BOOST_TYPEOF_TRANSFORM_PARAMS(Params),\
|
||||
BOOST_PP_SEQ_SIZE(Params),\
|
||||
BOOST_TYPEOF_UNIQUE_ID())\
|
||||
};\
|
||||
}}}
|
||||
|
||||
#endif//BOOST_TYPEOF_COMPLIANT_TEMPLATE_ENCODING_HPP_INCLUDED
|
||||
|
@ -6,9 +6,8 @@
|
||||
#ifndef BOOST_TYPEOF_COMPLIANT_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED
|
||||
#define BOOST_TYPEOF_COMPLIANT_TEMPLATE_TEMPLATE_PARAM_HPP_INCLUDED
|
||||
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
#include <boost/preprocessor/comparison/not_equal.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/logical/or.hpp>
|
||||
#include <boost/preprocessor/seq/fold_left.hpp>
|
||||
|
||||
#define BOOST_TYPEOF_MAKE_OBJ_template(x) BOOST_TYPEOF_TEMPLATE_PARAM(x)
|
||||
#define BOOST_TYPEOF_TEMPLATE(X) template(X) BOOST_TYPEOF_EAT
|
||||
@ -24,7 +23,7 @@
|
||||
//Encode / decode this
|
||||
#define BOOST_TYPEOF_TEMPLATE_PARAM_ENCODE(This, n)\
|
||||
typedef typename encode_template<BOOST_PP_CAT(V, n),\
|
||||
BOOST_PP_CAT(P, n)<BOOST_TYPEOF_SEQ_ENUM(BOOST_TYPEOF_TRANSFORM_PARAMS(BOOST_TYPEOF_TEMPLATE_PARAM_GETPARAMS(This)),BOOST_TYPEOF_PLACEHOLDER)>\
|
||||
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)\
|
||||
@ -44,9 +43,9 @@
|
||||
|
||||
// T3<int, (unsigned int)0, ...>
|
||||
#define BOOST_TYPEOF_TEMPLATE_PARAM_PLACEHOLDER_TYPES(Param, n)\
|
||||
BOOST_PP_CAT(T,n)<BOOST_TYPEOF_SEQ_ENUM_1(BOOST_TYPEOF_TRANSFORM_PARAMS(BOOST_TYPEOF_TEMPLATE_PARAM_GETPARAMS(Param)),BOOST_TYPEOF_PLACEHOLDER)>
|
||||
BOOST_PP_CAT(T,n)<BOOST_TYPEOF_SEQ_ENUM_1(BOOST_TYPEOF_MAKE_OBJS(BOOST_TYPEOF_TEMPLATE_PARAM_GETPARAMS(Param)),BOOST_TYPEOF_PLACEHOLDER)>
|
||||
|
||||
#define BOOST_TYPEOF_TEMPLATE_PARAM_TT_CATEGORY 2
|
||||
#define BOOST_TYPEOF_TEMPLATE_PARAM_ISTEMPLATE 1
|
||||
|
||||
////////////////////////////
|
||||
// move to encode_decode?
|
||||
@ -110,21 +109,16 @@ namespace boost
|
||||
#define BOOST_TYPEOF_REGISTER_DECLARE_DECODER_TYPE_PARAM_PAIR(z,n,elem) \
|
||||
BOOST_TYPEOF_VIRTUAL(DECLARATION_TYPE, elem)(elem) BOOST_PP_CAT(T, n)
|
||||
|
||||
#define BOOST_TYPEOF_CHECK_TT_CATEGORY(s, data, elem)\
|
||||
BOOST_PP_EQUAL(BOOST_TYPEOF_VIRTUAL(TT_CATEGORY, elem), data)
|
||||
// BOOST_TYPEOF_HAS_TEMPLATES
|
||||
#define BOOST_TYPEOF_HAS_TEMPLATES(Params)\
|
||||
BOOST_PP_SEQ_FOLD_LEFT(BOOST_TYPEOF_HAS_TEMPLATES_OP, 0, Params)
|
||||
|
||||
//Check if one of the arguments is a template template argument.
|
||||
#define BOOST_TYPEOF_HAS_TEMPLATE_TEMPLATE_ARGUMENTS(Params)\
|
||||
BOOST_PP_NOT_EQUAL(\
|
||||
BOOST_PP_SEQ_SIZE(\
|
||||
(_)BOOST_PP_SEQ_FILTER(BOOST_TYPEOF_CHECK_TT_CATEGORY,2,Params)\
|
||||
),\
|
||||
1\
|
||||
)
|
||||
#define BOOST_TYPEOF_HAS_TEMPLATES_OP(s, state, elem)\
|
||||
BOOST_PP_OR(state, BOOST_TYPEOF_VIRTUAL(ISTEMPLATE, elem))
|
||||
|
||||
//Define template template arguments
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_TEMPLATE_IMPL(Name,Params,ID)\
|
||||
BOOST_PP_IF(BOOST_TYPEOF_HAS_TEMPLATE_TEMPLATE_ARGUMENTS(Params),\
|
||||
BOOST_PP_IF(BOOST_TYPEOF_HAS_TEMPLATES(Params),\
|
||||
BOOST_TYPEOF_REGISTER_NOTHING,\
|
||||
BOOST_TYPEOF_REGISTER_TYPE_FOR_TEMPLATE_TEMPLATE)(Name,Params,ID)
|
||||
|
||||
|
@ -24,6 +24,6 @@
|
||||
#define BOOST_TYPEOF_TYPE_PARAM_PLACEHOLDER(Param) int
|
||||
#define BOOST_TYPEOF_TYPE_PARAM_DECLARATION_TYPE(Param) class
|
||||
#define BOOST_TYPEOF_TYPE_PARAM_PLACEHOLDER_TYPES(Param, n) BOOST_PP_CAT(T,n)
|
||||
#define BOOST_TYPEOF_TYPE_PARAM_TT_CATEGORY 1
|
||||
#define BOOST_TYPEOF_TYPE_PARAM_ISTEMPLATE 0
|
||||
|
||||
#endif//BOOST_TYPEOF_COMPLIANT_TYPE_TEMPLATE_PARAM_HPP_INCLUDED
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@ -12,6 +12,6 @@
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(std::bitset, (size_t))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::bitset, (size_t))
|
||||
|
||||
#endif//BOOST_TYPEOF_STD_bitset_hpp_INCLUDED
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
@ -33,8 +33,8 @@ BOOST_TYPEOF_REGISTER_TEMPLATE(std::time_put_byname, 2)
|
||||
BOOST_TYPEOF_REGISTER_TYPE(std::money_base)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::money_get, 2)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::money_put, 2)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(std::moneypunct, (class)(bool))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(std::moneypunct_byname, (class)(bool))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::moneypunct, (class)(bool))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::moneypunct_byname, (class)(bool))
|
||||
BOOST_TYPEOF_REGISTER_TYPE(std::messages_base)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::messages, 1)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::messages_byname, 1)
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb, Peder Holt.
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
@ -24,37 +24,84 @@
|
||||
|
||||
#define BOOST_TYPEOF_TO_SEQ(tokens) BOOST_TYPEOF_ ## tokens ## _BOOST_TYPEOF
|
||||
|
||||
// BOOST_TYPEOF_REGISTER_TEMPLATE
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE(Name, Params)\
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(\
|
||||
Name,\
|
||||
BOOST_TYPEOF_MAKE_OBJS(BOOST_TYPEOF_TOSEQ(Params)),\
|
||||
BOOST_PP_SEQ_SIZE(BOOST_TYPEOF_TOSEQ(Params)),\
|
||||
BOOST_TYPEOF_UNIQUE_ID())\
|
||||
|
||||
#define BOOST_TYPEOF_OBJECT_MAKER(s, data, elem)\
|
||||
BOOST_TYPEOF_MAKE_OBJ(elem)
|
||||
|
||||
#define BOOST_TYPEOF_MAKE_OBJS(Params)\
|
||||
BOOST_PP_SEQ_TRANSFORM(BOOST_TYPEOF_OBJECT_MAKER, ~, Params)
|
||||
|
||||
#define BOOST_TYPEOF_TOSEQ(x)\
|
||||
BOOST_PP_SEQ_CAT(\
|
||||
(BOOST_TYPEOF_STEP3)\
|
||||
(BOOST_PP_CAT(BOOST_TYPEOF_STEP2, BOOST_PP_EXPAND(BOOST_TYPEOF_STEP1 x)))\
|
||||
)
|
||||
|
||||
#define BOOST_TYPEOF_STEP1(x) _(x)
|
||||
#define BOOST_TYPEOF_STEP2BOOST_TYPEOF_STEP1
|
||||
#define BOOST_TYPEOF_STEP3BOOST_TYPEOF_STEP2_
|
||||
|
||||
#define BOOST_TYPEOF_STEP31 (class)
|
||||
#define BOOST_TYPEOF_STEP32 BOOST_TYPEOF_STEP31(class)
|
||||
#define BOOST_TYPEOF_STEP33 BOOST_TYPEOF_STEP32(class)
|
||||
#define BOOST_TYPEOF_STEP34 BOOST_TYPEOF_STEP33(class)
|
||||
#define BOOST_TYPEOF_STEP35 BOOST_TYPEOF_STEP34(class)
|
||||
#define BOOST_TYPEOF_STEP36 BOOST_TYPEOF_STEP35(class)
|
||||
#define BOOST_TYPEOF_STEP37 BOOST_TYPEOF_STEP36(class)
|
||||
#define BOOST_TYPEOF_STEP38 BOOST_TYPEOF_STEP37(class)
|
||||
#define BOOST_TYPEOF_STEP39 BOOST_TYPEOF_STEP38(class)
|
||||
#define BOOST_TYPEOF_STEP310 BOOST_TYPEOF_STEP39(class)
|
||||
#define BOOST_TYPEOF_STEP311 BOOST_TYPEOF_STEP310(class)
|
||||
#define BOOST_TYPEOF_STEP312 BOOST_TYPEOF_STEP311(class)
|
||||
#define BOOST_TYPEOF_STEP313 BOOST_TYPEOF_STEP312(class)
|
||||
#define BOOST_TYPEOF_STEP314 BOOST_TYPEOF_STEP313(class)
|
||||
#define BOOST_TYPEOF_STEP315 BOOST_TYPEOF_STEP314(class)
|
||||
#define BOOST_TYPEOF_STEP316 BOOST_TYPEOF_STEP315(class)
|
||||
#define BOOST_TYPEOF_STEP317 BOOST_TYPEOF_STEP316(class)
|
||||
#define BOOST_TYPEOF_STEP318 BOOST_TYPEOF_STEP317(class)
|
||||
#define BOOST_TYPEOF_STEP319 BOOST_TYPEOF_STEP318(class)
|
||||
#define BOOST_TYPEOF_STEP320 BOOST_TYPEOF_STEP319(class)
|
||||
|
||||
// "interface"
|
||||
|
||||
#define BOOST_TYPEOF_PARAM_EXPAND_TYPE(Param)\
|
||||
BOOST_PP_CAT(BOOST_TYPEOF_PARAM_EXPAND_, BOOST_PP_SEQ_ELEM(0, Param))(Param)
|
||||
|
||||
// BOOST_TYPEOF_VIRTUAL
|
||||
|
||||
//
|
||||
#define BOOST_TYPEOF_CAT_4(a, b, c, d) BOOST_TYPEOF_CAT_4_I(a, b, c, d)
|
||||
#define BOOST_TYPEOF_CAT_4_I(a, b, c, d) a ## b ## c ## d
|
||||
|
||||
#define BOOST_TYPEOF_VIRTUAL(Fun, Obj)\
|
||||
BOOST_TYPEOF_CAT_4(BOOST_TYPEOF_, BOOST_PP_SEQ_ELEM(0, Obj), _, Fun)
|
||||
//
|
||||
BOOST_TYPEOF_CAT_4(BOOST_TYPEOF_, BOOST_PP_SEQ_HEAD(Obj), _, Fun)
|
||||
|
||||
// BOOST_TYPEOF_SEQ_ENUM[_TRAILING][_1]
|
||||
// Two versions provided due to reentrancy issue
|
||||
|
||||
#define BOOST_TYPEOF_SEQ_EXPAND_ELEMENT(z,n,seq)\
|
||||
BOOST_PP_SEQ_ELEM(0,seq) (z,n,BOOST_PP_SEQ_ELEM(n,BOOST_PP_SEQ_ELEM(1,seq)))
|
||||
|
||||
#define BOOST_TYPEOF_SEQ_ENUM(seq,macro)\
|
||||
BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT,(macro)(seq))
|
||||
BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT,(macro)(seq))
|
||||
|
||||
#define BOOST_TYPEOF_SEQ_ENUM_TRAILING(seq,macro)\
|
||||
BOOST_PP_ENUM_TRAILING(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT,(macro)(seq))
|
||||
BOOST_PP_ENUM_TRAILING(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT,(macro)(seq))
|
||||
|
||||
#define BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1(z,n,seq)\
|
||||
BOOST_PP_SEQ_ELEM(0,seq) (z,n,BOOST_PP_SEQ_ELEM(n,BOOST_PP_SEQ_ELEM(1,seq)))
|
||||
BOOST_PP_SEQ_ELEM(0,seq) (z,n,BOOST_PP_SEQ_ELEM(n,BOOST_PP_SEQ_ELEM(1,seq)))
|
||||
|
||||
#define BOOST_TYPEOF_SEQ_ENUM_1(seq,macro)\
|
||||
BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1,(macro)(seq))
|
||||
BOOST_PP_ENUM(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1,(macro)(seq))
|
||||
|
||||
#define BOOST_TYPEOF_SEQ_ENUM_TRAILING_1(seq,macro)\
|
||||
BOOST_PP_ENUM_TRAILING(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1,(macro)(seq))
|
||||
BOOST_PP_ENUM_TRAILING(BOOST_PP_SEQ_SIZE(seq),BOOST_TYPEOF_SEQ_EXPAND_ELEMENT_1,(macro)(seq))
|
||||
|
||||
#endif//BOOST_TYPEOF_COMPLIANT_TEMPLATE_ENCODING_HPP_INCLUDED
|
||||
|
@ -5,6 +5,10 @@
|
||||
#ifndef BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
|
||||
#define BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/seq/cat.hpp>
|
||||
#include <boost/preprocessor/expand.hpp>
|
||||
|
||||
// implementation
|
||||
|
||||
#include <boost/typeof/config.hpp>
|
||||
@ -50,21 +54,9 @@
|
||||
# include <boost/typeof/vintage/template_encoding.hpp>
|
||||
#else//BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_REGISTER_TYPE(x)
|
||||
# define BOOST_TYPEOF_REGISTER_TEMPLATE_X(x, params)
|
||||
# define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
|
||||
#endif
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_TYPE_PARAM_(z, n, data) (typename)
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE(Name, n)\
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(Name,\
|
||||
BOOST_PP_REPEAT(n, BOOST_TYPEOF_REGISTER_TEMPLATE_TYPE_PARAM_, ~)\
|
||||
)
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_WITH_DEFAULTS(Name, n)\
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_WITH_DEFAULTS_X(Name,\
|
||||
BOOST_PP_REPEAT(n, BOOST_TYPEOF_REGISTER_TEMPLATE_TYPE_PARAM_, ~)\
|
||||
)
|
||||
|
||||
#define BOOST_TYPEOF_UNIQUE_ID()\
|
||||
BOOST_TYPEOF_REGISTRATION_GROUP * 0x10000 + __LINE__
|
||||
|
||||
|
@ -56,33 +56,30 @@
|
||||
#define BOOST_TYPEOF_INTEGRAL_PARAM_CAST(This, n)\
|
||||
BOOST_TYPEOF_PARAM_GETTYPE(This)(BOOST_PP_CAT(P,n))
|
||||
|
||||
//#define BOOST_TYPEOF_CAST_EXPLICIT_INTEGRAL_PARAM(This, n)\
|
||||
// BOOST_TYPEOF_PARAM_GETTYPE(This)(BOOST_PP_CAT(P,n))
|
||||
|
||||
//
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_DECODE_PARAM(r, data, n, elem)\
|
||||
BOOST_TYPEOF_VIRTUAL(DECODE, BOOST_TYPEOF_MAKE_OBJ(elem))(BOOST_TYPEOF_MAKE_OBJ(elem), n)
|
||||
BOOST_TYPEOF_VIRTUAL(DECODE, elem)(elem, n)
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_ENCODE_PARAM(r, data, n, elem)\
|
||||
, BOOST_TYPEOF_VIRTUAL(ENCODE, BOOST_TYPEOF_MAKE_OBJ(elem))(BOOST_TYPEOF_MAKE_OBJ(elem), n)
|
||||
, BOOST_TYPEOF_VIRTUAL(ENCODE, elem)(elem, n)
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_PARAM_PAIR(r, data, n, elem)\
|
||||
BOOST_PP_COMMA_IF(n) BOOST_TYPEOF_PARAM_GETTYPE(BOOST_TYPEOF_MAKE_OBJ(elem)) BOOST_PP_CAT(P, n)
|
||||
BOOST_PP_COMMA_IF(n) BOOST_TYPEOF_PARAM_GETTYPE(elem) BOOST_PP_CAT(P, n)
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_PARAM_CAST(r, data, n, elem)\
|
||||
BOOST_PP_COMMA_IF(n) BOOST_TYPEOF_VIRTUAL(CAST, BOOST_TYPEOF_MAKE_OBJ(elem))(BOOST_TYPEOF_MAKE_OBJ(elem), n)
|
||||
BOOST_PP_COMMA_IF(n) BOOST_TYPEOF_VIRTUAL(CAST, elem)(elem, n)
|
||||
|
||||
//
|
||||
|
||||
#define BOOST_TYPEOF_ENCODE_TEMPLATE_X_IMPL(Name, Params, ID)\
|
||||
#define BOOST_TYPEOF_ENCODE_TEMPLATE_IMPL(Name, Params, Size, ID)\
|
||||
template<>\
|
||||
struct encode_impl<ID>\
|
||||
{\
|
||||
template<typename V, BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),typename P),typename Types>\
|
||||
template<typename V, BOOST_PP_ENUM_PARAMS(Size,typename P),typename Types>\
|
||||
struct encoder {\
|
||||
typedef Types BOOST_PP_CAT(types_,BOOST_PP_SEQ_SIZE(Params));\
|
||||
BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(Params),BOOST_TYPEOF_PUSH_FRONT,BOOST_PP_SEQ_SIZE(Params))\
|
||||
typedef Types BOOST_PP_CAT(types_,Size);\
|
||||
BOOST_PP_REPEAT(Size,BOOST_TYPEOF_PUSH_FRONT,Size)\
|
||||
BOOST_STATIC_CONSTANT(int,value =sizeof(BOOST_DEDUCED_TYPENAME encode_modifier<mpl::next<V>::type,BOOST_DEDUCED_TYPENAME types_0::type,types_1>::encoded_type));\
|
||||
friend sizer<ID> encode_value(const sizer<V::index>&,const sizer<V::pos>&);\
|
||||
};\
|
||||
@ -98,9 +95,9 @@
|
||||
V\
|
||||
BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_ENCODE_PARAM,~,Params),\
|
||||
Types\
|
||||
> encode(Name<BOOST_PP_ENUM_PARAMS(BOOST_PP_SEQ_SIZE(Params),P)> const& (*)(V,Types));
|
||||
> encode(Name<BOOST_PP_ENUM_PARAMS(Size,P)> const& (*)(V,Types));
|
||||
|
||||
#define BOOST_TYPEOF_DECODE_TEMPLATE_X_IMPL(Name, Params, ID)\
|
||||
#define BOOST_TYPEOF_DECODE_TEMPLATE_IMPL(Name, Params, Size, ID)\
|
||||
template<>\
|
||||
struct decode_impl<ID>\
|
||||
{\
|
||||
@ -109,14 +106,15 @@
|
||||
typedef Iter iter0;\
|
||||
BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_DECODE_PARAM,~,Params)\
|
||||
typedef Name<BOOST_PP_SEQ_FOR_EACH_I(BOOST_TYPEOF_REGISTER_TEMPLATE_PARAM_CAST,~,Params)> type;\
|
||||
typedef BOOST_PP_CAT(iter,BOOST_PP_SEQ_SIZE(Params)) iter;\
|
||||
typedef BOOST_PP_CAT(iter,Size) iter;\
|
||||
};\
|
||||
};
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_X(template_type,seq)\
|
||||
namespace boost { namespace type_of{\
|
||||
BOOST_TYPEOF_ENCODE_TEMPLATE_X_IMPL(template_type,seq,BOOST_TYPEOF_UNIQUE_ID())\
|
||||
BOOST_TYPEOF_DECODE_TEMPLATE_X_IMPL(template_type,seq,BOOST_TYPEOF_UNIQUE_ID())\
|
||||
}}//namespace boost::type_of
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_IMPL(Name, Params, Size, ID)\
|
||||
namespace boost { namespace type_of{\
|
||||
BOOST_TYPEOF_ENCODE_TEMPLATE_IMPL(Name, Params, Size, ID)\
|
||||
BOOST_TYPEOF_DECODE_TEMPLATE_IMPL(Name, Params, Size, ID)\
|
||||
}}
|
||||
|
||||
|
||||
#endif //BOOST_VINTAGE_TEMPLATE_ENCODING_HPP_INCLUDED
|
||||
|
@ -25,6 +25,6 @@ BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::greater_action)
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::less_action)
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::and_action)
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::lambda::subscript_action)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(boost::lambda::placeholder, (int))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::lambda::placeholder, (int))
|
||||
|
||||
#endif//LAMBDA_REGISTER_HPP_INCLUDED
|
||||
|
@ -134,12 +134,6 @@
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\test_compliant.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
GeneratePreprocessedFile="0"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
@ -234,13 +228,6 @@
|
||||
RelativePath=".\lambda\register.hpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="stl"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\stl\register.hpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="mpl"
|
||||
Filter="">
|
||||
|
@ -1,3 +1,3 @@
|
||||
g++ -IC:\boost\boost_1_32_0 -I..\..\..\.. ..\main.cpp test_compliant.cpp odr1.cpp odr2.cpp
|
||||
g++ -IC:\boost\boost_1_32_0 -I..\..\..\.. -D BOOST_TYPEOF_COMPLIANT -D BOOST_TYPEOF_LIMIT_SIZE=50 -D BOOST_MPL_LIMIT_VECTOR_SIZE=50 test_compliant.cpp ..\main.cpp odr1.cpp odr2.cpp
|
||||
g++ -IC:\boost\boost_1_32_0 -I..\..\..\.. odr1.cpp odr2.cpp test_compliant.cpp ..\main.cpp
|
||||
|
||||
|
@ -65,8 +65,15 @@ namespace template_template {
|
||||
struct C {};
|
||||
}
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(template_template::tt_test,(BOOST_TYPEOF_TEMPLATE( (typename)(unsigned int) ))(int))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(template_template::C,(typename)(unsigned int))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(template_template::tt_test,
|
||||
(BOOST_TYPEOF_TEMPLATE((typename)(unsigned int)))
|
||||
(int)
|
||||
)
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(template_template::C,
|
||||
(typename)
|
||||
(unsigned int)
|
||||
)
|
||||
|
||||
BOOST_STATIC_ASSERT((typeof_test<template_template::tt_test<template_template::C,4> >::value));
|
||||
#endif
|
||||
@ -100,7 +107,7 @@ template<class T, char c, unsigned short us,
|
||||
int i, unsigned long ul, bool b1, bool b2, signed char sc, unsigned u> struct with_integrals
|
||||
{};
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(with_integrals,
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(with_integrals,
|
||||
(class)
|
||||
(char)
|
||||
(unsigned short)
|
||||
@ -249,18 +256,18 @@ namespace test_integral
|
||||
{};
|
||||
}
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(test_integral::foo,
|
||||
(BOOST_TYPEOF_INTEGRAL(test_integral::E))
|
||||
);
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(test_integral::foo,
|
||||
(BOOST_TYPEOF_INTEGRAL(test_integral::E))
|
||||
);
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(test_integral::blah,
|
||||
(BOOST_TYPEOF_INTEGRAL(unsigned long int))
|
||||
);
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(test_integral::blah,
|
||||
(BOOST_TYPEOF_INTEGRAL(unsigned long int))
|
||||
);
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(test_integral::bar,
|
||||
(class)
|
||||
(BOOST_TYPEOF_INTEGRAL(P0))
|
||||
);
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(test_integral::bar,
|
||||
(class)
|
||||
(BOOST_TYPEOF_INTEGRAL(P0))
|
||||
);
|
||||
|
||||
namespace test_integral
|
||||
{
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(std::vector, (class)(class))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::vector, (class)(class))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::list, 2)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::set, 3)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(std::allocator, 1)
|
||||
|
Reference in New Issue
Block a user