mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-23 17:17:23 +02:00
Merge remote-tracking branch 'origin/develop' into feature/constexpr
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2009-2010 Hartmut Kaiser
|
||||
Copyright (c) 2010-2011 Christopher Schmidt
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -13,6 +14,9 @@
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
#include <boost/preprocessor/comparison/less.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
@ -22,6 +26,7 @@
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
|
||||
@ -32,17 +37,21 @@
|
||||
#include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/adapted/adt/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/adt/detail/adapt_base.hpp>
|
||||
#include <boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_FILLER_0(A, B, C, D)\
|
||||
((A, B, C, D)) BOOST_FUSION_ADAPT_ADT_FILLER_1
|
||||
#define BOOST_FUSION_ADAPT_ADT_FILLER_1(A, B, C, D)\
|
||||
((A, B, C, D)) BOOST_FUSION_ADAPT_ADT_FILLER_0
|
||||
#define BOOST_FUSION_ADAPT_ADT_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_ADT_FILLER_1_END
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
|
||||
BOOST_FUSION_ADAPT_ADT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 4)
|
||||
#define BOOST_FUSION_ADAPT_ADT_C( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \
|
||||
BOOST_FUSION_ADAPT_ADT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ, \
|
||||
NAME_SEQ, \
|
||||
I, \
|
||||
BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_LESS( \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4) \
|
||||
, 1, 0))
|
||||
|
||||
#define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
|
@ -2,6 +2,7 @@
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2007 Dan Marsden
|
||||
Copyright (c) 2010-2011 Christopher Schmidt
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -22,6 +23,7 @@
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
|
||||
@ -35,25 +37,29 @@
|
||||
#include <boost/fusion/adapted/struct/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/adapted/adt/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/adt/detail/adapt_base.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(A, B, C, D, E)\
|
||||
((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(A, B, C, D, E)\
|
||||
((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1_END
|
||||
#include <boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_C( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_ADT_C_BASE(TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,5) \
|
||||
BOOST_FUSION_ADAPT_ADT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ, \
|
||||
NAME_SEQ, \
|
||||
I, \
|
||||
BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_LESS( \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5) \
|
||||
, 1, 0)) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct struct_assoc_key<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(5, 4, ATTRIBUTE) type; \
|
||||
typedef BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) type;\
|
||||
};
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( \
|
||||
|
@ -11,17 +11,18 @@
|
||||
#define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_auto.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp>
|
||||
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#if defined(BOOST_GCC)
|
||||
#define BOOST_FUSION_ADT_CONSTEXPR BOOST_CXX14_CONSTEXPR
|
||||
#else
|
||||
#define BOOST_FUSION_ADT_CONSTEXPR BOOST_CONSTEXPR
|
||||
#endif
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ) \
|
||||
typename detail::get_identity< \
|
||||
@ -34,8 +35,72 @@
|
||||
\
|
||||
boost::remove_const<boost::remove_reference<lvalue>::type>::type
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \
|
||||
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \
|
||||
BOOST_PP_IF(DEDUCE_TYPE, 0, 2), ATTRIBUTE)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \
|
||||
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \
|
||||
BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE)
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \
|
||||
ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
struct deduced_attr_type { \
|
||||
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
|
||||
typedef \
|
||||
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \
|
||||
BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \
|
||||
ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \
|
||||
};
|
||||
|
||||
#else
|
||||
# define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \
|
||||
ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
|
||||
struct deduced_attr_type { \
|
||||
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
|
||||
typedef BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \
|
||||
ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \
|
||||
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
BOOST_FUSION_DEDUCED_ATTR_TYPE( \
|
||||
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
typedef \
|
||||
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \
|
||||
boost::remove_const< \
|
||||
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \
|
||||
deduced_attr_type::type \
|
||||
>::type type; \
|
||||
\
|
||||
typedef \
|
||||
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \
|
||||
boost::add_const< \
|
||||
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \
|
||||
deduced_attr_type::type \
|
||||
>::type const_type;
|
||||
|
||||
#define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \
|
||||
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) const_type;
|
||||
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX, \
|
||||
ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
@ -45,6 +110,16 @@
|
||||
, I \
|
||||
> \
|
||||
{ \
|
||||
\
|
||||
BOOST_PP_IF(DEDUCE_TYPE, \
|
||||
BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF, \
|
||||
BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE)( \
|
||||
NAME_SEQ, \
|
||||
ATTRIBUTE, \
|
||||
ATTRIBUTE_TUPEL_SIZE, \
|
||||
PREFIX, \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
template<class Val> \
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
static void \
|
||||
@ -52,23 +127,26 @@
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj, \
|
||||
Val const& val) \
|
||||
{ \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \
|
||||
PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \
|
||||
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \
|
||||
} \
|
||||
\
|
||||
BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
static type \
|
||||
boost_fusion_adapt_adt_impl_get( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \
|
||||
{ \
|
||||
return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
|
||||
return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \
|
||||
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \
|
||||
} \
|
||||
\
|
||||
BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
static const_type \
|
||||
boost_fusion_adapt_adt_impl_get( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \
|
||||
{ \
|
||||
return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
|
||||
return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \
|
||||
ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
@ -81,7 +159,12 @@
|
||||
, true \
|
||||
> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) type; \
|
||||
typedef \
|
||||
BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \
|
||||
access::adt_attribute_access< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
>::const_type type; \
|
||||
\
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
explicit \
|
||||
@ -90,7 +173,7 @@
|
||||
: obj(&o) \
|
||||
{} \
|
||||
\
|
||||
BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
type get() const \
|
||||
{ \
|
||||
return access::adt_attribute_access< \
|
||||
@ -99,7 +182,7 @@
|
||||
>::boost_fusion_adapt_adt_impl_get(*obj); \
|
||||
} \
|
||||
\
|
||||
BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
operator type() const \
|
||||
{ \
|
||||
return get(); \
|
||||
@ -117,7 +200,12 @@
|
||||
, false \
|
||||
> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
|
||||
typedef \
|
||||
BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \
|
||||
access::adt_attribute_access< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
>::type type; \
|
||||
\
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
explicit \
|
||||
@ -138,7 +226,7 @@
|
||||
return *this; \
|
||||
} \
|
||||
\
|
||||
BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
type get() const \
|
||||
{ \
|
||||
return access::adt_attribute_access< \
|
||||
@ -147,7 +235,7 @@
|
||||
>::boost_fusion_adapt_adt_impl_get(*obj); \
|
||||
} \
|
||||
\
|
||||
BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
operator type() const \
|
||||
{ \
|
||||
return get(); \
|
||||
@ -164,7 +252,13 @@
|
||||
, I \
|
||||
> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \
|
||||
typedef BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \
|
||||
adt_attribute_proxy< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
, false \
|
||||
>::type lvalue; \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
|
@ -0,0 +1,61 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTER_ADT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP
|
||||
#define BOOST_FUSION_ADAPTER_ADT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp>
|
||||
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/variadic/size.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(...) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(__VA_ARGS__) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(...) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(__VA_ARGS__) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(...) \
|
||||
((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__)))
|
||||
|
||||
#else // BOOST_PP_VARIADICS
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(A, B, C, D, E) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(A, B, C, D, E) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \
|
||||
BOOST_PP_IF(BOOST_PP_IS_EMPTY(A), \
|
||||
((3, (C,D,E))), \
|
||||
((5, (A,B,C,D,E))) \
|
||||
)
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1_END
|
||||
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
|
||||
BOOST_PP_SUB(BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE))
|
||||
|
||||
#endif
|
@ -0,0 +1,90 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP
|
||||
#define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp>
|
||||
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/logical/or.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/tuple/size.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
#include <boost/preprocessor/variadic/to_seq.hpp>
|
||||
#include <boost/preprocessor/variadic/to_tuple.hpp>
|
||||
#include <boost/preprocessor/variadic/elem.hpp>
|
||||
#include <boost/preprocessor/seq/for_each.hpp>
|
||||
#include <boost/preprocessor/seq/push_front.hpp>
|
||||
#include <boost/preprocessor/seq/rest_n.hpp>
|
||||
|
||||
#include <boost/preprocessor/tuple/reverse.hpp>
|
||||
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE) \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE) \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
# define BOOST_FUSION_ADAPT_ADT_FILLER_0(...) \
|
||||
BOOST_FUSION_ADAPT_ADT_FILLER(__VA_ARGS__) \
|
||||
BOOST_FUSION_ADAPT_ADT_FILLER_1
|
||||
|
||||
# define BOOST_FUSION_ADAPT_ADT_FILLER_1(...) \
|
||||
BOOST_FUSION_ADAPT_ADT_FILLER(__VA_ARGS__) \
|
||||
BOOST_FUSION_ADAPT_ADT_FILLER_0
|
||||
|
||||
# define BOOST_FUSION_ADAPT_ADT_FILLER_0_END
|
||||
# define BOOST_FUSION_ADAPT_ADT_FILLER_1_END
|
||||
|
||||
# define BOOST_FUSION_ADAPT_ADT_FILLER(...) \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_OR( \
|
||||
BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \
|
||||
BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__))), \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAP_ATTR( \
|
||||
BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__), \
|
||||
BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(__VA_ARGS__) \
|
||||
), \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(__VA_ARGS__))
|
||||
|
||||
# define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(...) \
|
||||
((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__)))
|
||||
|
||||
# define BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(...) \
|
||||
BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REST_N( \
|
||||
BOOST_PP_SUB(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 1), \
|
||||
BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)))
|
||||
|
||||
#else // BOOST_PP_VARIADICS
|
||||
|
||||
# define BOOST_FUSION_ADAPT_ADT_FILLER_0(A, B, C, D) \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A,B,C,D) \
|
||||
BOOST_FUSION_ADAPT_ADT_FILLER_1
|
||||
|
||||
# define BOOST_FUSION_ADAPT_ADT_FILLER_1(A, B, C, D) \
|
||||
BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A,B,C,D) \
|
||||
BOOST_FUSION_ADAPT_ADT_FILLER_0
|
||||
|
||||
# define BOOST_FUSION_ADAPT_ADT_FILLER_0_END
|
||||
# define BOOST_FUSION_ADAPT_ADT_FILLER_1_END
|
||||
|
||||
# define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A, B, C, D) \
|
||||
BOOST_PP_IF(BOOST_PP_IS_EMPTY(A), \
|
||||
((2, (C,D))), \
|
||||
((4, (A,B,C,D))) \
|
||||
)
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
||||
#endif
|
@ -109,4 +109,13 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Array, int Pos>
|
||||
struct iterator_traits< ::boost::fusion::array_iterator<Array, Pos> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -207,6 +207,15 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Cons>
|
||||
struct iterator_traits< ::boost::fusion::boost_tuple_iterator<Cons> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -114,6 +114,15 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Iterator>
|
||||
struct iterator_traits< ::boost::fusion::mpl_iterator<Iterator> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -107,6 +107,15 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Tuple, int Index>
|
||||
struct iterator_traits< ::boost::fusion::std_tuple_iterator<Tuple, Index> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <boost/fusion/adapted/struct/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
|
||||
@ -35,32 +36,35 @@
|
||||
#include <boost/fusion/adapted/struct/detail/key_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_of_data_impl.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \
|
||||
((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \
|
||||
((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE) \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,PREFIX,ATTRIBUTE) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, PREFIX, ATTRIBUTE, 3) \
|
||||
TEMPLATE_PARAMS_SEQ, \
|
||||
NAME_SEQ, \
|
||||
IS_VIEW, \
|
||||
I, \
|
||||
PREFIX, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
|
||||
BOOST_PP_IF(BOOST_PP_LESS( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3), 1, 0)) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct struct_assoc_key<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(3, 2, ATTRIBUTE) type; \
|
||||
typedef \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) type; \
|
||||
};
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, I, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE)
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,BOOST_PP_EMPTY,ATTRIBUTE)
|
||||
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
Copyright (c) 2009-2011 Christopher Schmidt
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -10,8 +11,12 @@
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/preprocessor/config/config.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/comparison/less.hpp>
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
@ -19,6 +24,7 @@
|
||||
|
||||
#include <boost/fusion/adapted/struct/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
|
||||
@ -30,43 +36,88 @@
|
||||
#include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \
|
||||
((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_1
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \
|
||||
((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_0
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_C( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ, \
|
||||
NAME_SEQ, \
|
||||
IS_VIEW, \
|
||||
I, \
|
||||
BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_LESS( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2) \
|
||||
, 1, 0))
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\
|
||||
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE,2)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(1)TEMPLATE_PARAMS_SEQ, \
|
||||
(1)NAME_SEQ, \
|
||||
struct_tag, \
|
||||
0, \
|
||||
((0,0)) BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
1, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
# define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ...) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(1)TEMPLATE_PARAMS_SEQ, \
|
||||
(1)NAME_SEQ, \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT(NAME, ...) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ...) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
1, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
#else // BOOST_PP_VARIADICS
|
||||
|
||||
# define BOOST_FUSION_ADAPT_TPL_STRUCT( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(1)TEMPLATE_PARAMS_SEQ, \
|
||||
(1)NAME_SEQ, \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES, \
|
||||
_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
1, \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES, \
|
||||
_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
||||
#endif
|
||||
|
@ -15,26 +15,41 @@
|
||||
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0(X, Y) \
|
||||
(X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1(X, Y) \
|
||||
(X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1_END
|
||||
#ifdef BOOST_PP_VARIADICS
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
|
||||
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
|
||||
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ...) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
|
||||
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
|
||||
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0 ATTRIBUTES,_END))
|
||||
BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \
|
||||
(0)NAMESPACE_SEQ)NAME, \
|
||||
__VA_ARGS__)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
|
||||
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ...) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
|
||||
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,__VA_ARGS__)
|
||||
|
||||
|
||||
#else // BOOST_PP_VARIADICS
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
|
||||
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
|
||||
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \
|
||||
(0)NAMESPACE_SEQ)NAME, \
|
||||
ATTRIBUTES)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
|
||||
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -12,6 +12,13 @@
|
||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/define_struct.hpp>
|
||||
|
||||
#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(X, Y, Z) \
|
||||
((X, Y, Z)) BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1
|
||||
#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1(X, Y, Z) \
|
||||
((X, Y, Z)) BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0
|
||||
#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0_END
|
||||
#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1_END
|
||||
|
||||
#define BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT( \
|
||||
TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
|
||||
\
|
||||
@ -20,7 +27,7 @@
|
||||
(0)NAMESPACE_SEQ, \
|
||||
NAME, \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \
|
||||
3) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \
|
||||
@ -34,7 +41,7 @@
|
||||
(0)NAMESPACE_SEQ, \
|
||||
NAME, \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \
|
||||
3) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT( \
|
||||
|
@ -19,7 +19,7 @@
|
||||
TEMPLATE_PARAMS_SEQ, \
|
||||
(0)NAMESPACE_SEQ, \
|
||||
NAME, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
|
||||
BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
|
||||
2) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_TPL_STRUCT( \
|
||||
@ -32,7 +32,7 @@
|
||||
BOOST_FUSION_DEFINE_STRUCT_IMPL( \
|
||||
(0)NAMESPACE_SEQ, \
|
||||
NAME, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
|
||||
BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
|
||||
2) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT( \
|
||||
|
15
include/boost/fusion/adapted/struct/detail/adapt_auto.hpp
Normal file
15
include/boost/fusion/adapted/struct/detail/adapt_auto.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP
|
||||
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY()
|
||||
|
||||
#endif
|
@ -2,6 +2,7 @@
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
Copyright (c) 2009-2011 Christopher Schmidt
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -13,6 +14,8 @@
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_auto.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp>
|
||||
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
@ -25,12 +28,16 @@
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/comparison/less.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/tag.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \
|
||||
BOOST_PP_SEQ_HEAD(SEQ)<BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TAIL(SEQ))> \
|
||||
BOOST_PP_EMPTY()
|
||||
@ -55,6 +62,49 @@
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \
|
||||
BOOST_PP_TUPLE_EAT(1))(SEQ)
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \
|
||||
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
struct deduced_attr_type { \
|
||||
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
|
||||
typedef \
|
||||
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \
|
||||
BOOST_TYPEOF( PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \
|
||||
0, ATTRIBUTE)) \
|
||||
type; \
|
||||
}; \
|
||||
\
|
||||
typedef \
|
||||
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \
|
||||
deduced_attr_type::type attribute_type;
|
||||
|
||||
#else
|
||||
# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \
|
||||
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
struct deduced_attr_type { \
|
||||
static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
|
||||
typedef BOOST_TYPEOF( \
|
||||
PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) \
|
||||
type; \
|
||||
}; \
|
||||
\
|
||||
typedef \
|
||||
BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \
|
||||
deduced_attr_type::type attribute_type;
|
||||
|
||||
#endif
|
||||
|
||||
#define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \
|
||||
NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \
|
||||
typedef \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) attribute_type;
|
||||
|
||||
|
||||
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
|
||||
MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
|
||||
@ -83,9 +133,10 @@
|
||||
#endif
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL(R,DATA,I,ATTRIBUTE) \
|
||||
BOOST_PP_TUPLE_ELEM(3,0,DATA)( \
|
||||
BOOST_PP_TUPLE_ELEM(3,1,DATA), \
|
||||
BOOST_PP_TUPLE_ELEM(3,2,DATA), \
|
||||
BOOST_PP_TUPLE_ELEM(4,0,DATA)( \
|
||||
BOOST_PP_TUPLE_ELEM(4,1,DATA), \
|
||||
BOOST_PP_TUPLE_ELEM(4,2,DATA), \
|
||||
BOOST_PP_TUPLE_ELEM(4,3,DATA), \
|
||||
I, \
|
||||
ATTRIBUTE)
|
||||
|
||||
@ -107,7 +158,9 @@
|
||||
#endif
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, \
|
||||
I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, \
|
||||
DEDUCE_TYPE) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
@ -117,9 +170,14 @@
|
||||
, I \
|
||||
> \
|
||||
{ \
|
||||
typedef \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
|
||||
attribute_type; \
|
||||
BOOST_PP_IF(DEDUCE_TYPE, \
|
||||
BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE)( \
|
||||
NAME_SEQ, \
|
||||
ATTRIBUTE, \
|
||||
ATTRIBUTE_TUPEL_SIZE, \
|
||||
PREFIX, \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
@ -143,7 +201,8 @@
|
||||
call(Seq& seq) \
|
||||
{ \
|
||||
return seq.PREFIX() \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \
|
||||
BOOST_PP_IF(DEDUCE_TYPE, 0, 1), ATTRIBUTE); \
|
||||
} \
|
||||
}; \
|
||||
}; \
|
||||
@ -163,7 +222,9 @@
|
||||
call() \
|
||||
{ \
|
||||
return BOOST_PP_STRINGIZE( \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)); \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \
|
||||
BOOST_PP_IF(DEDUCE_TYPE, 0, 1), \
|
||||
ATTRIBUTE)); \
|
||||
} \
|
||||
};
|
||||
|
||||
@ -195,7 +256,7 @@ namespace boost
|
||||
BOOST_PP_TUPLE_EAT(4))( \
|
||||
1, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \
|
||||
(ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ), \
|
||||
(ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ, IS_VIEW),\
|
||||
BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ)) \
|
||||
\
|
||||
template< \
|
||||
|
@ -0,0 +1,63 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp>
|
||||
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/variadic/size.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(...) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(__VA_ARGS__) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(...) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(__VA_ARGS__) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(...) \
|
||||
((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__)))
|
||||
|
||||
#else // BOOST_PP_VARIADICS
|
||||
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \
|
||||
BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \
|
||||
((2, (Y,Z))), \
|
||||
((3, (X,Y,Z))) \
|
||||
)
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END
|
||||
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \
|
||||
BOOST_PP_SUB(BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE))
|
||||
|
||||
#endif
|
@ -0,0 +1,64 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp>
|
||||
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/tuple/size.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
#include <boost/preprocessor/variadic/to_seq.hpp>
|
||||
#include <boost/preprocessor/seq/for_each.hpp>
|
||||
#include <boost/preprocessor/seq/push_front.hpp>
|
||||
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X,Y) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_FILLER_1
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X,Y) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_FILLER_0
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X, Y) \
|
||||
BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \
|
||||
((1, (Y))), \
|
||||
((2, (X,Y))) \
|
||||
)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE) \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE) \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)
|
||||
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, unused, elem) \
|
||||
BOOST_PP_IF(BOOST_FUSION_PP_IS_SEQ(elem), \
|
||||
BOOST_PP_CAT( BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(BOOST_FUSION_ADAPT_AUTO, \
|
||||
elem))
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(...) \
|
||||
BOOST_PP_SEQ_PUSH_FRONT( \
|
||||
BOOST_PP_SEQ_FOR_EACH( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP, \
|
||||
unused, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)), \
|
||||
(0,0))
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
||||
#endif
|
14
include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp
Normal file
14
include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2013-2014 Damien Buhl
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP
|
||||
|
||||
#define BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ) \
|
||||
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ)
|
||||
|
||||
#endif
|
@ -34,6 +34,13 @@
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_FILLER_0(X, Y) \
|
||||
((X, Y)) BOOST_FUSION_DEFINE_STRUCT_FILLER_1
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_FILLER_1(X, Y) \
|
||||
((X, Y)) BOOST_FUSION_DEFINE_STRUCT_FILLER_0
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_FILLER_0_END
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_FILLER_1_END
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \
|
||||
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \
|
||||
\
|
||||
|
@ -302,7 +302,7 @@
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_DEFINE_STRUCT_MEMBERS_IMPL( \
|
||||
NAME, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END))
|
||||
BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0 ATTRIBUTES,_END))
|
||||
|
||||
// Note: can't compute BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ) directly because
|
||||
// ATTRIBUTES_SEQ may be empty and calling BOOST_PP_SEQ_SIZE on an empty
|
||||
@ -316,7 +316,7 @@
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_DEFINE_STRUCT_ITERATOR_IMPL( \
|
||||
NAME, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END))
|
||||
BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0 ATTRIBUTES,_END))
|
||||
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_ITERATOR_IMPL(NAME, ATTRIBUTES_SEQ) \
|
||||
BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR_IMPL_IMPL( \
|
||||
|
@ -0,0 +1,41 @@
|
||||
/*=============================================================================
|
||||
BOOST_PP_VARIADICS version of BOOST_PP_IS_SEQ inspired from
|
||||
boost/mpl/aux_/preprocessor/is_seq.hpp, original copyrights goes to :
|
||||
|
||||
Copyright Paul Mensonides 2003
|
||||
Copyright Aleksey Gurtovoy 2003-2004
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP
|
||||
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/punctuation/paren.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/config/config.hpp>
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
#define BOOST_FUSION_PP_IS_SEQ(seq) BOOST_PP_CAT(BOOST_FUSION_PP_IS_SEQ_, \
|
||||
BOOST_FUSION_PP_IS_SEQ_0 seq BOOST_PP_RPAREN())
|
||||
|
||||
#define BOOST_FUSION_PP_IS_SEQ_0(...) \
|
||||
BOOST_FUSION_PP_IS_SEQ_1(__VA_ARGS__
|
||||
|
||||
#define BOOST_FUSION_PP_IS_SEQ_ALWAYS_0(...) \
|
||||
0
|
||||
|
||||
#define BOOST_FUSION_PP_IS_SEQ_BOOST_FUSION_PP_IS_SEQ_0 \
|
||||
BOOST_FUSION_PP_IS_SEQ_ALWAYS_0(
|
||||
|
||||
#define BOOST_FUSION_PP_IS_SEQ_BOOST_FUSION_PP_IS_SEQ_1(...) \
|
||||
1
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
||||
#endif
|
@ -12,6 +12,8 @@
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/namespace.hpp>
|
||||
|
||||
#define BOOST_FUSION_PROXY_PREFIX() obj.
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
|
||||
WRAPPED_TYPE,NAMESPACE_SEQ,NAME) \
|
||||
\
|
||||
|
@ -118,4 +118,13 @@ namespace boost { namespace fusion {
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Seq, int Pos>
|
||||
struct iterator_traits< ::boost::fusion::deque_iterator<Seq, Pos> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -141,7 +141,10 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
{}
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>&& seq)
|
||||
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>&& seq
|
||||
, typename disable_if<
|
||||
is_convertible<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>, T0>
|
||||
>::type* /*dummy*/ = 0)
|
||||
: base(std::forward<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>>(seq))
|
||||
{}
|
||||
template <typename T>
|
||||
|
@ -66,7 +66,8 @@ namespace boost { namespace fusion { namespace detail
|
||||
|
||||
template <typename U, typename Rst>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
keyed_element(keyed_element<Key, U, Rst> const& rhs)
|
||||
keyed_element(keyed_element<Key, U, Rst> const& rhs
|
||||
, typename enable_if<is_convertible<U, Value> >::type* = 0)
|
||||
: Rest(rhs.get_base()), value_(rhs.value_)
|
||||
{}
|
||||
|
||||
|
@ -99,4 +99,13 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Cons>
|
||||
struct iterator_traits< ::boost::fusion::cons_iterator<Cons> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -24,6 +24,15 @@
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/preprocessor/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
|
||||
defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
|
||||
// see map_forward_ctor.hpp
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
|
||||
#include <boost/fusion/container/map/detail/cpp03/preprocessed/map.hpp>
|
||||
@ -45,6 +54,8 @@
|
||||
#pragma wave option(preserve: 1)
|
||||
#endif
|
||||
|
||||
#define FUSION_HASH #
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct void_;
|
||||
@ -69,6 +80,10 @@ namespace boost { namespace fusion
|
||||
map()
|
||||
: data() {}
|
||||
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
map(map const& rhs)
|
||||
: data(rhs.data) {}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
map(Sequence const& rhs)
|
||||
@ -91,6 +106,34 @@ namespace boost { namespace fusion
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
|
||||
(defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
map(map&& rhs)
|
||||
: data(std::move(rhs.data)) {}
|
||||
|
||||
template <typename T>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
map& operator=(T&& rhs)
|
||||
{
|
||||
data = BOOST_FUSION_FWD_ELEM(T, rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
map& operator=(map&& rhs)
|
||||
{
|
||||
data = std::move(rhs.data);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
FUSION_HASH endif
|
||||
#endif
|
||||
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
storage_type& get_data() { return data; }
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
@ -102,6 +145,8 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#undef FUSION_HASH
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
#pragma wave option(output: null)
|
||||
#endif
|
||||
|
@ -8,15 +8,14 @@
|
||||
#if !defined(FUSION_MAP_FORWARD_CTOR_07222005_0106)
|
||||
#define FUSION_MAP_FORWARD_CTOR_07222005_0106
|
||||
|
||||
#include <boost/preprocessor/iterate.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#define FUSION_FORWARD_CTOR_FORWARD(z, n, _) BOOST_FUSION_FWD_ELEM(U##n, _##n)
|
||||
|
||||
#define BOOST_PP_FILENAME_1 \
|
||||
<boost/fusion/container/map/detail/cpp03/map_forward_ctor.hpp>
|
||||
#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_MAP_SIZE)
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#undef FUSION_FORWARD_CTOR_FORWARD
|
||||
#endif
|
||||
#else // defined(BOOST_PP_IS_ITERATING)
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -34,6 +33,31 @@
|
||||
map(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param<T, >::type arg))
|
||||
: data(BOOST_PP_ENUM_PARAMS(N, arg)) {}
|
||||
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
|
||||
(defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename U)>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
#if N == 1
|
||||
explicit
|
||||
#endif
|
||||
map(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && arg)
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) && \
|
||||
N == 1
|
||||
// workaround for MSVC 10
|
||||
FUSION_HASH if defined(BOOST_MSVC) && (BOOST_MSVC == 1700)
|
||||
, typename enable_if<is_same<U0, T0> >::type* = 0
|
||||
FUSION_HASH endif
|
||||
#endif
|
||||
)
|
||||
: data(BOOST_PP_ENUM(N, FUSION_FORWARD_CTOR_FORWARD, arg)) {}
|
||||
#endif
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
FUSION_HASH endif
|
||||
#endif
|
||||
|
||||
#undef N
|
||||
#endif // defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
|
@ -163,4 +163,13 @@ namespace boost { namespace fusion
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Seq, int Pos>
|
||||
struct iterator_traits< ::boost::fusion::map_iterator<Seq, Pos> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -49,5 +49,14 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Vector, int N>
|
||||
struct iterator_traits< ::boost::fusion::vector_iterator<Vector, N> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -144,4 +144,13 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Tag, typename Category, typename Seq, int Index>
|
||||
struct iterator_traits< ::boost::fusion::basic_iterator<Tag, Category, Seq, Index> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -135,4 +135,13 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Derived, typename Iterator, typename Category>
|
||||
struct iterator_traits< ::boost::fusion::iterator_adapter<Derived, Iterator, Category> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -56,4 +56,13 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Derived, typename Category>
|
||||
struct iterator_traits< ::boost::fusion::iterator_facade<Derived, Category> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -68,4 +68,23 @@ namespace boost { namespace fusion { namespace detail
|
||||
# define BOOST_FUSION_FWD_ELEM(type, value) std::forward<type>(value)
|
||||
#endif
|
||||
|
||||
|
||||
// Workaround for LWG 2408: C++17 SFINAE-friendly std::iterator_traits.
|
||||
// http://cplusplus.github.io/LWG/lwg-defects.html#2408
|
||||
//
|
||||
// - GCC 4.5 enables the feature under C++11.
|
||||
// https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01105.html
|
||||
//
|
||||
// - Only MSVC 12.0 doesn't have the feature.
|
||||
#if (defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 40500) && \
|
||||
defined(BOOST_LIBSTDCXX11)) || \
|
||||
(defined(BOOST_MSVC) && (BOOST_MSVC == 1800))
|
||||
# define BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename>
|
||||
struct iterator_traits;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -12,6 +12,10 @@
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
#include <functional>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion { namespace traits
|
||||
{
|
||||
template <typename T> struct deduce;
|
||||
@ -86,6 +90,21 @@ namespace boost { namespace fusion { namespace traits
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
// Also unwrap C++11 std::ref if available (referencee cv is deduced)
|
||||
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
template <typename T>
|
||||
struct deduce<std::reference_wrapper<T> &>
|
||||
{
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct deduce<std::reference_wrapper<T> const &>
|
||||
{
|
||||
typedef T& type;
|
||||
};
|
||||
#endif
|
||||
|
||||
// Keep references on arrays, even if const
|
||||
|
||||
template <typename T, int N>
|
||||
|
@ -11,6 +11,10 @@
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
#include <functional>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
template <typename T>
|
||||
@ -25,6 +29,14 @@ namespace boost { namespace fusion { namespace detail
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL
|
||||
template <typename T>
|
||||
struct as_fusion_element<std::reference_wrapper<T> >
|
||||
{
|
||||
typedef T& type;
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename T, int N>
|
||||
struct as_fusion_element<T[N]>
|
||||
{
|
||||
|
@ -67,6 +67,15 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Category, typename First, typename Last, typename Pred>
|
||||
struct iterator_traits< ::boost::fusion::filter_iterator<Category, First, Last, Pred> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -204,6 +204,15 @@ namespace boost { namespace fusion { namespace extension
|
||||
};
|
||||
}}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename First, typename Base>
|
||||
struct iterator_traits< ::boost::fusion::flatten_view_iterator<First, Base> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -56,6 +56,15 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Category, typename First, typename Last, typename Concat>
|
||||
struct iterator_traits< ::boost::fusion::joint_view_iterator<Category, First, Last, Concat> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -55,6 +55,15 @@ namespace boost { namespace fusion
|
||||
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Sequence, typename Pos>
|
||||
struct iterator_traits< ::boost::fusion::nview_iterator<Sequence, Pos> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -53,5 +53,14 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename Sequence, typename Pos>
|
||||
struct iterator_traits< ::boost::fusion::repetitive_view_iterator<Sequence, Pos> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -54,5 +54,14 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename First>
|
||||
struct iterator_traits< ::boost::fusion::reverse_view_iterator<First> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -51,6 +51,15 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename SingleView, typename Pos>
|
||||
struct iterator_traits< ::boost::fusion::single_view_iterator<SingleView, Pos> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
@ -76,5 +76,17 @@ namespace boost { namespace fusion
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename First, typename F>
|
||||
struct iterator_traits< ::boost::fusion::transform_view_iterator<First, F> >
|
||||
{ };
|
||||
template <typename First1, typename First2, typename F>
|
||||
struct iterator_traits< ::boost::fusion::transform_view_iterator2<First1, First2, F> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -46,4 +46,13 @@ namespace boost { namespace fusion {
|
||||
};
|
||||
}}
|
||||
|
||||
#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
template <typename IteratorSequence, typename Traversal>
|
||||
struct iterator_traits< ::boost::fusion::zip_view_iterator<IteratorSequence, Traversal> >
|
||||
{ };
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user