mirror of
https://github.com/boostorg/typeof.git
synced 2025-07-30 21:07:24 +02:00
Changes required for the integration process
[SVN r2357]
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#ifndef BOOST_TYPEOF_VINTAGE_CONFIG_HPP_INCLUDED
|
||||
#define BOOST_TYPEOF_VINTAGE_CONFIG_HPP_INCLUDED
|
||||
|
@ -2,8 +2,8 @@
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_VINTAGE_PRESERVE_LVALUE_HPP_INCLUDED
|
||||
#define BOOST_VINTAGE_PRESERVE_LVALUE_HPP_INCLUDED
|
||||
#ifndef BOOST_VINTAGE_LVALUE_TYPEOF_HPP_INCLUDED
|
||||
#define BOOST_VINTAGE_LVALUE_TYPEOF_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
|
||||
@ -59,11 +59,11 @@ namespace boost
|
||||
// Since this is always a type,
|
||||
// just add "typename" when using in templates
|
||||
|
||||
#define BOOST_TYPEOF_PRESERVE_LVALUE(expr) \
|
||||
#define BOOST_LVALUE_TYPEOF(expr) \
|
||||
boost::type_of::decorate_type< \
|
||||
BOOST_TYPEOF(expr), \
|
||||
sizeof(*boost::type_of::classify_expression(expr)) \
|
||||
sizeof(*boost::type_of::classify_expression(expr)) \
|
||||
>::type
|
||||
|
||||
|
||||
#endif //BOOST_VINTAGE_PRESERVE_LVALUE_HPP_INCLUDED
|
||||
#endif //BOOST_VINTAGE_LVALUE_TYPEOF_HPP_INCLUDED
|
@ -4,6 +4,45 @@
|
||||
|
||||
#define n BOOST_PP_ITERATION()
|
||||
|
||||
template<>
|
||||
struct encode_impl<FUN_REF_ID + n>
|
||||
{
|
||||
template<typename V,typename R BOOST_PP_ENUM_TRAILING_PARAMS(n,typename A),typename Types>
|
||||
struct encoder {
|
||||
typedef Types BOOST_PP_CAT(types_,n);
|
||||
BOOST_PP_REPEAT(n,BOOST_TYPEOF_PUSH_FRONT,n)
|
||||
BOOST_STATIC_CONSTANT(int,instantiate =
|
||||
sizeof(
|
||||
encode_modifier<
|
||||
mpl::next<V>::type,
|
||||
R,
|
||||
types_0
|
||||
>::encoded_type
|
||||
)
|
||||
);
|
||||
friend sizer<FUN_REF_ID + n> encode_value(const sizer<V::index>&,const sizer<V::pos>&);
|
||||
};
|
||||
};
|
||||
|
||||
template<typename V,typename R BOOST_PP_ENUM_TRAILING_PARAMS(n,typename A),typename Types>
|
||||
typename encode_impl<FUN_REF_ID + n>::template encoder<V,R BOOST_PP_ENUM_TRAILING_PARAMS(n,A),Types>
|
||||
encode(R (& (*function)(V,Types))(BOOST_PP_ENUM_PARAMS(n,A)) );
|
||||
|
||||
template<>
|
||||
struct decode_impl<FUN_REF_ID + n>
|
||||
{
|
||||
template<typename Iter>
|
||||
struct decoder {
|
||||
typedef Iter iterR;
|
||||
typedef decode_impl<TYPEOF_GET_VALUE(iterR)>::decoder<TYPEOF_GET_NEXT(iterR)> decodeR;
|
||||
typedef typename decodeR::type R;
|
||||
typedef typename decodeR::iter iter0;
|
||||
BOOST_TYPEOF_DECODE_PARAMS(n);
|
||||
typedef R (&type)(BOOST_PP_ENUM_PARAMS(n,A));
|
||||
typedef BOOST_PP_CAT(iter,n) iter;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct encode_impl<FUN_ID + n>
|
||||
{
|
||||
@ -26,49 +65,10 @@ struct encode_impl<FUN_ID + n>
|
||||
|
||||
template<typename V,typename R BOOST_PP_ENUM_TRAILING_PARAMS(n,typename A),typename Types>
|
||||
typename encode_impl<FUN_ID + n>::template encoder<V,R BOOST_PP_ENUM_TRAILING_PARAMS(n,A),Types>
|
||||
encode(R (& (*function)(V,Types))(BOOST_PP_ENUM_PARAMS(n,A)) );
|
||||
|
||||
template<>
|
||||
struct decode_impl<FUN_ID + n>
|
||||
{
|
||||
template<typename Iter>
|
||||
struct decoder {
|
||||
typedef Iter iterR;
|
||||
typedef decode_impl<TYPEOF_GET_VALUE(iterR)>::decoder<TYPEOF_GET_NEXT(iterR)> decodeR;
|
||||
typedef typename decodeR::type R;
|
||||
typedef typename decodeR::iter iter0;
|
||||
BOOST_TYPEOF_DECODE_PARAMS(n);
|
||||
typedef R (&type)(BOOST_PP_ENUM_PARAMS(n,A));
|
||||
typedef BOOST_PP_CAT(iter,n) iter;
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct encode_impl<FUN_PTR_ID + n>
|
||||
{
|
||||
template<typename V,typename R BOOST_PP_ENUM_TRAILING_PARAMS(n,typename A),typename Types>
|
||||
struct encoder {
|
||||
typedef Types BOOST_PP_CAT(types_,n);
|
||||
BOOST_PP_REPEAT(n,BOOST_TYPEOF_PUSH_FRONT,n)
|
||||
BOOST_STATIC_CONSTANT(int,instantiate =
|
||||
sizeof(
|
||||
encode_modifier<
|
||||
mpl::next<V>::type,
|
||||
R,
|
||||
types_0
|
||||
>::encoded_type
|
||||
)
|
||||
);
|
||||
friend sizer<FUN_PTR_ID + n> encode_value(const sizer<V::index>&,const sizer<V::pos>&);
|
||||
};
|
||||
};
|
||||
|
||||
template<typename V,typename R BOOST_PP_ENUM_TRAILING_PARAMS(n,typename A),typename Types>
|
||||
typename encode_impl<FUN_PTR_ID + n>::template encoder<V,R BOOST_PP_ENUM_TRAILING_PARAMS(n,A),Types>
|
||||
encode(R (* const& (*function)(V,Types))(BOOST_PP_ENUM_PARAMS(n,A)) );
|
||||
|
||||
template<>
|
||||
struct decode_impl<FUN_PTR_ID + n>
|
||||
struct decode_impl<FUN_ID + n>
|
||||
{
|
||||
template<typename Iter>
|
||||
struct decoder {
|
||||
|
@ -79,11 +79,4 @@ namespace boost { namespace type_of{\
|
||||
BOOST_TYPEOF_DECODE_TEMPLATE(template_type,seq)\
|
||||
}}//namespace boost::type_of
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE_TYPE_PARAM_(z, n, data) (typename)
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE(template_type, n)\
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE_X(template_type,\
|
||||
BOOST_PP_REPEAT(n, BOOST_TYPEOF_REGISTER_TEMPLATE_TYPE_PARAM_, ~)\
|
||||
)
|
||||
|
||||
#endif //BOOST_VINTAGE_TEMPLATE_ENCODING_HPP_INCLUDED
|
||||
|
Reference in New Issue
Block a user