summaryrefslogtreecommitdiff
path: root/boost/fusion/adapted
diff options
context:
space:
mode:
Diffstat (limited to 'boost/fusion/adapted')
-rw-r--r--boost/fusion/adapted/adt/adapt_adt.hpp29
-rw-r--r--boost/fusion/adapted/adt/adapt_assoc_adt.hpp26
-rw-r--r--boost/fusion/adapted/adt/detail/adapt_base.hpp128
-rw-r--r--boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp61
-rw-r--r--boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp90
-rw-r--r--boost/fusion/adapted/adt/detail/extension.hpp6
-rw-r--r--boost/fusion/adapted/array/at_impl.hpp2
-rw-r--r--boost/fusion/adapted/array/begin_impl.hpp2
-rw-r--r--boost/fusion/adapted/array/deref_impl.hpp2
-rw-r--r--boost/fusion/adapted/array/end_impl.hpp2
-rw-r--r--boost/fusion/adapted/boost_array/array_iterator.hpp17
-rw-r--r--boost/fusion/adapted/boost_array/detail/at_impl.hpp4
-rw-r--r--boost/fusion/adapted/boost_array/detail/begin_impl.hpp6
-rw-r--r--boost/fusion/adapted/boost_array/detail/end_impl.hpp6
-rw-r--r--boost/fusion/adapted/boost_tuple.hpp2
-rw-r--r--boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp29
-rw-r--r--boost/fusion/adapted/boost_tuple/detail/build_cons.hpp59
-rw-r--r--boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp50
-rw-r--r--boost/fusion/adapted/boost_tuple/mpl/clear.hpp23
-rw-r--r--boost/fusion/adapted/mpl/detail/at_impl.hpp2
-rw-r--r--boost/fusion/adapted/mpl/detail/begin_impl.hpp2
-rw-r--r--boost/fusion/adapted/mpl/detail/end_impl.hpp2
-rw-r--r--boost/fusion/adapted/mpl/mpl_iterator.hpp19
-rw-r--r--boost/fusion/adapted/std_tuple.hpp2
-rw-r--r--boost/fusion/adapted/std_tuple/detail/at_impl.hpp2
-rw-r--r--boost/fusion/adapted/std_tuple/detail/begin_impl.hpp2
-rw-r--r--boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp105
-rw-r--r--boost/fusion/adapted/std_tuple/detail/convert_impl.hpp48
-rw-r--r--boost/fusion/adapted/std_tuple/detail/end_impl.hpp2
-rw-r--r--boost/fusion/adapted/std_tuple/mpl/clear.hpp23
-rw-r--r--boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp18
-rw-r--r--boost/fusion/adapted/struct/adapt_assoc_struct.hpp28
-rw-r--r--boost/fusion/adapted/struct/adapt_struct.hpp127
-rw-r--r--boost/fusion/adapted/struct/adapt_struct_named.hpp53
-rw-r--r--boost/fusion/adapted/struct/define_assoc_struct.hpp11
-rw-r--r--boost/fusion/adapted/struct/define_struct.hpp4
-rw-r--r--boost/fusion/adapted/struct/detail/adapt_auto.hpp15
-rw-r--r--boost/fusion/adapted/struct/detail/adapt_base.hpp85
-rw-r--r--boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp63
-rw-r--r--boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp64
-rw-r--r--boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp14
-rw-r--r--boost/fusion/adapted/struct/detail/begin_impl.hpp4
-rw-r--r--boost/fusion/adapted/struct/detail/define_struct.hpp27
-rw-r--r--boost/fusion/adapted/struct/detail/define_struct_inline.hpp29
-rw-r--r--boost/fusion/adapted/struct/detail/deref_impl.hpp5
-rw-r--r--boost/fusion/adapted/struct/detail/end_impl.hpp4
-rw-r--r--boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp41
-rw-r--r--boost/fusion/adapted/struct/detail/proxy_type.hpp4
48 files changed, 1161 insertions, 188 deletions
diff --git a/boost/fusion/adapted/adt/adapt_adt.hpp b/boost/fusion/adapted/adt/adapt_adt.hpp
index 3be25b1efc..7ff6f4eee2 100644
--- a/boost/fusion/adapted/adt/adapt_adt.hpp
+++ b/boost/fusion/adapted/adt/adapt_adt.hpp
@@ -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( \
diff --git a/boost/fusion/adapted/adt/adapt_assoc_adt.hpp b/boost/fusion/adapted/adt/adapt_assoc_adt.hpp
index 12bf6aa24f..49a8805d8a 100644
--- a/boost/fusion/adapted/adt/adapt_assoc_adt.hpp
+++ b/boost/fusion/adapted/adt/adapt_assoc_adt.hpp
@@ -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( \
diff --git a/boost/fusion/adapted/adt/detail/adapt_base.hpp b/boost/fusion/adapted/adt/detail/adapt_base.hpp
index 3de396dd6b..dec17251df 100644
--- a/boost/fusion/adapted/adt/detail/adapt_base.hpp
+++ b/boost/fusion/adapted/adt/detail/adapt_base.hpp
@@ -11,11 +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>
+
+#include <boost/typeof/typeof.hpp>
#define BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ) \
typename detail::get_identity< \
@@ -28,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) \
@@ -39,30 +110,43 @@
, 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_FUSION_GPU_ENABLED \
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static void \
boost_fusion_adapt_adt_impl_set( \
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_GPU_ENABLED \
- static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
+ 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_GPU_ENABLED \
- static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
+ 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); \
} \
}; \
\
@@ -75,9 +159,14 @@
, 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_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
explicit \
adt_attribute_proxy( \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& o) \
@@ -111,9 +200,14 @@
, 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_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
explicit \
adt_attribute_proxy( \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& o) \
@@ -121,7 +215,7 @@
{} \
\
template<class Val> \
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
adt_attribute_proxy& \
operator=(Val const& val) \
{ \
@@ -158,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) \
\
@@ -181,7 +281,7 @@
> \
type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type \
call(Seq& obj) \
{ \
diff --git a/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp b/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp
new file mode 100644
index 0000000000..b9c93b7d59
--- /dev/null
+++ b/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp
@@ -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
diff --git a/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp b/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp
new file mode 100644
index 0000000000..09bd4014ed
--- /dev/null
+++ b/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp
@@ -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
diff --git a/boost/fusion/adapted/adt/detail/extension.hpp b/boost/fusion/adapted/adt/detail/extension.hpp
index 6349118053..c7d258953f 100644
--- a/boost/fusion/adapted/adt/detail/extension.hpp
+++ b/boost/fusion/adapted/adt/detail/extension.hpp
@@ -17,7 +17,7 @@
#include <boost/fusion/adapted/struct/detail/extension.hpp>
namespace boost { namespace fusion
-{
+{
namespace detail
{
template <typename T, typename Dummy>
@@ -25,12 +25,12 @@ namespace boost { namespace fusion
: remove_const<typename remove_reference<T>::type>
{};
}
-
+
namespace extension
{
// Overload as_const() to unwrap adt_attribute_proxy.
template <typename T, int N, bool Const>
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename adt_attribute_proxy<T, N, Const>::type as_const(const adt_attribute_proxy<T, N, Const>& proxy)
{
return proxy.get();
diff --git a/boost/fusion/adapted/array/at_impl.hpp b/boost/fusion/adapted/array/at_impl.hpp
index 084fffc208..369c8e2e00 100644
--- a/boost/fusion/adapted/array/at_impl.hpp
+++ b/boost/fusion/adapted/array/at_impl.hpp
@@ -27,7 +27,7 @@ namespace boost { namespace fusion { namespace extension
add_reference<typename remove_extent<Seq>::type>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Seq& seq)
{
diff --git a/boost/fusion/adapted/array/begin_impl.hpp b/boost/fusion/adapted/array/begin_impl.hpp
index 4ffaba01f1..8ea5a00ecf 100644
--- a/boost/fusion/adapted/array/begin_impl.hpp
+++ b/boost/fusion/adapted/array/begin_impl.hpp
@@ -31,7 +31,7 @@ namespace boost { namespace fusion { namespace extension
>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Seq& seq)
{
diff --git a/boost/fusion/adapted/array/deref_impl.hpp b/boost/fusion/adapted/array/deref_impl.hpp
index a7dc7cb9ca..a5719c3a71 100644
--- a/boost/fusion/adapted/array/deref_impl.hpp
+++ b/boost/fusion/adapted/array/deref_impl.hpp
@@ -29,7 +29,7 @@ namespace boost { namespace fusion { namespace extension
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(It const& it)
{
diff --git a/boost/fusion/adapted/array/end_impl.hpp b/boost/fusion/adapted/array/end_impl.hpp
index d36c6b81b3..e4ab63cef9 100644
--- a/boost/fusion/adapted/array/end_impl.hpp
+++ b/boost/fusion/adapted/array/end_impl.hpp
@@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace extension
>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Seq& seq)
{
diff --git a/boost/fusion/adapted/boost_array/array_iterator.hpp b/boost/fusion/adapted/boost_array/array_iterator.hpp
index 0e39d45709..ca8da0a22c 100644
--- a/boost/fusion/adapted/boost_array/array_iterator.hpp
+++ b/boost/fusion/adapted/boost_array/array_iterator.hpp
@@ -32,7 +32,7 @@ namespace boost { namespace fusion
typedef mpl::int_<Pos> index;
typedef Array array_type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
array_iterator(Array& a)
: array(a) {}
@@ -57,7 +57,7 @@ namespace boost { namespace fusion
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const & it)
{
@@ -72,7 +72,7 @@ namespace boost { namespace fusion
typedef typename Iterator::array_type array_type;
typedef array_iterator<array_type, index::value + N::value> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& i)
{
@@ -95,7 +95,7 @@ namespace boost { namespace fusion
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(I1 const&, I2 const&)
{
@@ -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
diff --git a/boost/fusion/adapted/boost_array/detail/at_impl.hpp b/boost/fusion/adapted/boost_array/detail/at_impl.hpp
index 15235e8e57..e355d02240 100644
--- a/boost/fusion/adapted/boost_array/detail/at_impl.hpp
+++ b/boost/fusion/adapted/boost_array/detail/at_impl.hpp
@@ -14,7 +14,7 @@
#include <boost/mpl/if.hpp>
namespace boost { namespace fusion {
-
+
struct boost_array_tag;
namespace extension
@@ -33,7 +33,7 @@ namespace boost { namespace fusion {
typename Sequence::const_reference,
typename Sequence::reference>::type type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence& seq)
{
diff --git a/boost/fusion/adapted/boost_array/detail/begin_impl.hpp b/boost/fusion/adapted/boost_array/detail/begin_impl.hpp
index 5e0752c145..8481b765af 100644
--- a/boost/fusion/adapted/boost_array/detail/begin_impl.hpp
+++ b/boost/fusion/adapted/boost_array/detail/begin_impl.hpp
@@ -24,11 +24,11 @@ namespace boost { namespace fusion {
struct begin_impl<boost_array_tag>
{
template <typename Sequence>
- struct apply
+ struct apply
{
typedef array_iterator<Sequence, 0> type;
-
- BOOST_FUSION_GPU_ENABLED
+
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence& v)
{
diff --git a/boost/fusion/adapted/boost_array/detail/end_impl.hpp b/boost/fusion/adapted/boost_array/detail/end_impl.hpp
index 13ed1e3e3d..7574b36405 100644
--- a/boost/fusion/adapted/boost_array/detail/end_impl.hpp
+++ b/boost/fusion/adapted/boost_array/detail/end_impl.hpp
@@ -24,11 +24,11 @@ namespace boost { namespace fusion {
struct end_impl<boost_array_tag>
{
template <typename Sequence>
- struct apply
+ struct apply
{
typedef array_iterator<Sequence, Sequence::static_size> type;
-
- BOOST_FUSION_GPU_ENABLED
+
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence& v)
{
diff --git a/boost/fusion/adapted/boost_tuple.hpp b/boost/fusion/adapted/boost_tuple.hpp
index 85af576461..7ef65686b6 100644
--- a/boost/fusion/adapted/boost_tuple.hpp
+++ b/boost/fusion/adapted/boost_tuple.hpp
@@ -17,5 +17,7 @@
#include <boost/fusion/adapted/boost_tuple/detail/size_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/at_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp>
+#include <boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp>
+#include <boost/fusion/adapted/boost_tuple/mpl/clear.hpp>
#endif
diff --git a/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp b/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp
index 416880b4e9..850eef5fa7 100644
--- a/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp
+++ b/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp
@@ -42,12 +42,18 @@ namespace boost { namespace fusion
struct boost_tuple_is_empty<tuples::tuple<> const> : mpl::true_ {};
}
+ template <typename Cons>
+ struct boost_tuple_iterator_identity;
+
template <typename Cons = tuples::null_type>
struct boost_tuple_iterator
: iterator_facade<boost_tuple_iterator<Cons>, forward_traversal_tag>
{
typedef Cons cons_type;
+ typedef boost_tuple_iterator_identity<
+ typename add_const<Cons>::type> identity;
+
BOOST_FUSION_GPU_ENABLED
explicit boost_tuple_iterator(Cons& in_cons)
: cons(in_cons) {}
@@ -98,7 +104,7 @@ namespace boost { namespace fusion
return type(iter.cons.get_tail());
}
};
-
+
template <typename I1, typename I2>
struct distance;
@@ -115,7 +121,7 @@ namespace boost { namespace fusion
>::type
>::type type;
};
-
+
template <typename I1, typename I2>
struct distance
{
@@ -124,7 +130,7 @@ namespace boost { namespace fusion
mpl::int_<0>,
lazy_next_distance<I1, I2>
>::type type;
-
+
BOOST_FUSION_GPU_ENABLED
static type
call(I1 const&, I2 const&)
@@ -133,6 +139,11 @@ namespace boost { namespace fusion
}
};
+ template <typename I1, typename I2>
+ struct equal_to
+ : is_same<typename I1::identity, typename I2::identity>
+ {};
+
private:
// silence MSVC warning C4512: assignment operator could not be generated
boost_tuple_iterator& operator= (boost_tuple_iterator const&);
@@ -144,6 +155,9 @@ namespace boost { namespace fusion
{
typedef Null cons_type;
+ typedef boost_tuple_iterator_identity<
+ typename add_const<Null>::type> identity;
+
template <typename I1, typename I2>
struct equal_to
: mpl::or_<
@@ -193,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
diff --git a/boost/fusion/adapted/boost_tuple/detail/build_cons.hpp b/boost/fusion/adapted/boost_tuple/detail/build_cons.hpp
new file mode 100644
index 0000000000..216fb0a614
--- /dev/null
+++ b/boost/fusion/adapted/boost_tuple/detail/build_cons.hpp
@@ -0,0 +1,59 @@
+/*=============================================================================
+ Copyright (c) 2012-2014 Kohei Takahashi
+
+ 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)
+==============================================================================*/
+#if !defined(BOOST_FUSION_BUILD_CONS_10172012_0130)
+#define BOOST_FUSION_BUILD_CONS_10172012_0130
+
+#include <boost/tuple/tuple.hpp>
+#include <boost/fusion/iterator/equal_to.hpp>
+#include <boost/fusion/iterator/next.hpp>
+#include <boost/fusion/iterator/value_of.hpp>
+#include <boost/fusion/iterator/deref.hpp>
+
+namespace boost { namespace fusion { namespace detail
+{
+ template <
+ typename First
+ , typename Last
+ , bool is_empty = result_of::equal_to<First, Last>::value>
+ struct build_tuple_cons;
+
+ template <typename First, typename Last>
+ struct build_tuple_cons<First, Last, true>
+ {
+ typedef boost::tuples::null_type type;
+
+ BOOST_FUSION_GPU_ENABLED
+ static type
+ call(First const&, Last const&)
+ {
+ return type();
+ }
+ };
+
+ template <typename First, typename Last>
+ struct build_tuple_cons<First, Last, false>
+ {
+ typedef
+ build_tuple_cons<typename result_of::next<First>::type, Last>
+ next_build_tuple_cons;
+
+ typedef boost::tuples::cons<
+ typename result_of::value_of<First>::type
+ , typename next_build_tuple_cons::type>
+ type;
+
+ BOOST_FUSION_GPU_ENABLED
+ static type
+ call(First const& f, Last const& l)
+ {
+ typename result_of::value_of<First>::type v = *f;
+ return type(v, next_build_tuple_cons::call(fusion::next(f), l));
+ }
+ };
+}}}
+
+#endif
diff --git a/boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp b/boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp
new file mode 100644
index 0000000000..8f2fbeec8f
--- /dev/null
+++ b/boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp
@@ -0,0 +1,50 @@
+/*=============================================================================
+ Copyright (c) 2012-2014 Kohei Takahashi
+
+ 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)
+==============================================================================*/
+#if !defined(BOOST_FUSION_CONVERT_IMPL_10172012_0120)
+#define BOOST_FUSION_CONVERT_IMPL_10172012_0120
+
+#include <boost/tuple/tuple.hpp>
+#include <boost/fusion/adapted/boost_tuple/detail/build_cons.hpp>
+#include <boost/fusion/sequence/intrinsic/begin.hpp>
+#include <boost/fusion/sequence/intrinsic/end.hpp>
+
+namespace boost { namespace fusion
+{
+ struct boost_tuple_tag;
+
+ namespace extension
+ {
+ template <typename T>
+ struct convert_impl;
+
+ template <>
+ struct convert_impl<boost_tuple_tag>
+ {
+ template <typename Sequence>
+ struct apply
+ {
+ typedef typename
+ detail::build_tuple_cons<
+ typename result_of::begin<Sequence>::type
+ , typename result_of::end<Sequence>::type
+ >
+ build_tuple_cons;
+
+ typedef typename build_tuple_cons::type type;
+
+ BOOST_FUSION_GPU_ENABLED
+ static type
+ call(Sequence& seq)
+ {
+ return build_tuple_cons::call(fusion::begin(seq), fusion::end(seq));
+ }
+ };
+ };
+ }
+}}
+
+#endif
diff --git a/boost/fusion/adapted/boost_tuple/mpl/clear.hpp b/boost/fusion/adapted/boost_tuple/mpl/clear.hpp
new file mode 100644
index 0000000000..1cca019c6d
--- /dev/null
+++ b/boost/fusion/adapted/boost_tuple/mpl/clear.hpp
@@ -0,0 +1,23 @@
+/*=============================================================================
+ Copyright (c) 2012 Kohei Takahashi
+
+ 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)
+==============================================================================*/
+#if !defined(BOOST_FUSION_CLEAR_10172012_0100)
+#define BOOST_FUSION_CLEAR_10172012_0100
+
+#include <boost/mpl/identity.hpp>
+#include <boost/fusion/adapted/boost_tuple/tag_of.hpp>
+
+namespace boost { namespace fusion { namespace detail {
+
+ template <typename Tag>
+ struct clear;
+
+ template <>
+ struct clear<boost_tuple_tag> : mpl::identity<boost::tuple<> > {};
+
+}}}
+
+#endif
diff --git a/boost/fusion/adapted/mpl/detail/at_impl.hpp b/boost/fusion/adapted/mpl/detail/at_impl.hpp
index 3fcafaac1d..232ca4df5f 100644
--- a/boost/fusion/adapted/mpl/detail/at_impl.hpp
+++ b/boost/fusion/adapted/mpl/detail/at_impl.hpp
@@ -28,7 +28,7 @@ namespace boost { namespace fusion
{
typedef typename mpl::at<Sequence, N>::type type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence)
{
diff --git a/boost/fusion/adapted/mpl/detail/begin_impl.hpp b/boost/fusion/adapted/mpl/detail/begin_impl.hpp
index c64e2828f4..3f087bda48 100644
--- a/boost/fusion/adapted/mpl/detail/begin_impl.hpp
+++ b/boost/fusion/adapted/mpl/detail/begin_impl.hpp
@@ -33,7 +33,7 @@ namespace boost { namespace fusion {
>::type iterator;
typedef mpl_iterator<iterator> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence)
{
diff --git a/boost/fusion/adapted/mpl/detail/end_impl.hpp b/boost/fusion/adapted/mpl/detail/end_impl.hpp
index 579e5a69e0..7ef13fb4f8 100644
--- a/boost/fusion/adapted/mpl/detail/end_impl.hpp
+++ b/boost/fusion/adapted/mpl/detail/end_impl.hpp
@@ -33,7 +33,7 @@ namespace boost { namespace fusion
>::type iterator;
typedef mpl_iterator<iterator> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence)
{
diff --git a/boost/fusion/adapted/mpl/mpl_iterator.hpp b/boost/fusion/adapted/mpl/mpl_iterator.hpp
index cc03767293..87de32ada1 100644
--- a/boost/fusion/adapted/mpl/mpl_iterator.hpp
+++ b/boost/fusion/adapted/mpl/mpl_iterator.hpp
@@ -38,7 +38,7 @@ namespace boost { namespace fusion
typename Iterator::iterator_type>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator)
{
@@ -53,7 +53,7 @@ namespace boost { namespace fusion
typename mpl::next<typename Iterator::iterator_type>::type>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator)
{
@@ -68,7 +68,7 @@ namespace boost { namespace fusion
typename mpl::prior<typename Iterator::iterator_type>::type>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator)
{
@@ -83,7 +83,7 @@ namespace boost { namespace fusion
typename mpl::advance<typename Iterator::iterator_type, N>::type>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& /*i*/)
{
@@ -104,7 +104,7 @@ namespace boost { namespace fusion
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(I1 const&, I2 const&)
{
@@ -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
diff --git a/boost/fusion/adapted/std_tuple.hpp b/boost/fusion/adapted/std_tuple.hpp
index 984a4df478..b7e847916d 100644
--- a/boost/fusion/adapted/std_tuple.hpp
+++ b/boost/fusion/adapted/std_tuple.hpp
@@ -16,7 +16,9 @@
#include <boost/fusion/adapted/std_tuple/detail/size_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/at_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/value_at_impl.hpp>
+#include <boost/fusion/adapted/std_tuple/detail/convert_impl.hpp>
#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp>
#include <boost/fusion/adapted/std_tuple/tag_of.hpp>
+#include <boost/fusion/adapted/std_tuple/mpl/clear.hpp>
#endif
diff --git a/boost/fusion/adapted/std_tuple/detail/at_impl.hpp b/boost/fusion/adapted/std_tuple/detail/at_impl.hpp
index cffd442885..47a20a25ed 100644
--- a/boost/fusion/adapted/std_tuple/detail/at_impl.hpp
+++ b/boost/fusion/adapted/std_tuple/detail/at_impl.hpp
@@ -40,7 +40,7 @@ namespace boost { namespace fusion
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence& seq)
{
diff --git a/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp b/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp
index 33613c20b1..1d5d392bab 100644
--- a/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp
+++ b/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp
@@ -27,7 +27,7 @@ namespace boost { namespace fusion
{
typedef std_tuple_iterator<Sequence, 0> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence& v)
{
diff --git a/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp b/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp
new file mode 100644
index 0000000000..41e0d434e8
--- /dev/null
+++ b/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp
@@ -0,0 +1,105 @@
+/*=============================================================================
+ Copyright (c) 2014 Kohei Takahashi
+
+ 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)
+==============================================================================*/
+#if !defined(BOOST_FUSION_BUILD_STD_TUPLE_05292014_0100)
+#define BOOST_FUSION_BUILD_STD_TUPLE_05292014_0100
+
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/fusion/support/config.hpp>
+#include <boost/fusion/iterator/equal_to.hpp>
+#include <boost/fusion/iterator/next.hpp>
+#include <boost/fusion/iterator/value_of.hpp>
+#include <boost/fusion/iterator/deref.hpp>
+#include <tuple>
+
+namespace boost { namespace fusion { namespace detail
+{
+ template <typename First, typename Last
+ , bool is_empty = result_of::equal_to<First, Last>::value
+ >
+ struct build_std_tuple;
+
+ template <typename First, typename Last>
+ struct build_std_tuple<First, Last, true>
+ {
+ typedef std::tuple<> type;
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ static type
+ call(First const&, Last const&)
+ {
+ return type();
+ }
+ };
+
+ template <int ...> struct indexed_tuple { };
+
+ template <int, typename = indexed_tuple<>>
+ struct make_indexed_tuple;
+
+ template <int Head, int ...Tail>
+ struct make_indexed_tuple<Head, indexed_tuple<Tail...>>
+ {
+ typedef typename
+ boost::mpl::eval_if_c<
+ (Head == 0),
+ boost::mpl::identity<indexed_tuple<Tail...>>,
+ make_indexed_tuple<Head - 1, indexed_tuple<Head - 1, Tail...>>
+ >::type
+ type;
+ };
+
+ template <typename T, typename Rest>
+ struct push_front_std_tuple;
+
+ template <typename T, typename ...Rest>
+ struct push_front_std_tuple<T, std::tuple<Rest...>>
+ {
+ typedef std::tuple<T, Rest...> type;
+
+ template <int ...I>
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ static type
+ indexed_call(T const& first, std::tuple<Rest...> const& rest, indexed_tuple<I...>)
+ {
+ return type(first, std::get<I>(rest)...);
+ }
+
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ static type
+ call(T const& first, std::tuple<Rest...> const& rest)
+ {
+ typedef typename make_indexed_tuple<sizeof...(Rest)>::type gen;
+ return indexed_call(first, rest, gen());
+ }
+ };
+
+ template <typename First, typename Last>
+ struct build_std_tuple<First, Last, false>
+ {
+ typedef
+ build_std_tuple<typename result_of::next<First>::type, Last>
+ next_build_std_tuple;
+
+ typedef push_front_std_tuple<
+ typename result_of::value_of<First>::type
+ , typename next_build_std_tuple::type>
+ push_front;
+
+ typedef typename push_front::type type;
+
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ static type
+ call(First const& f, Last const& l)
+ {
+ typename result_of::value_of<First>::type v = *f;
+ return push_front::call(
+ v, next_build_std_tuple::call(fusion::next(f), l));
+ }
+ };
+}}}
+
+#endif
diff --git a/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp b/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp
new file mode 100644
index 0000000000..96b67b11fd
--- /dev/null
+++ b/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp
@@ -0,0 +1,48 @@
+/*=============================================================================
+ Copyright (c) 2012-2014 Kohei Takahashi
+
+ 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)
+==============================================================================*/
+#if !defined(BOOST_FUSION_CONVERT_IMPL_10172012_0940)
+#define BOOST_FUSION_CONVERT_IMPL_10172012_0940
+
+#include <boost/fusion/support/config.hpp>
+#include <boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp>
+#include <boost/fusion/sequence/intrinsic/begin.hpp>
+#include <boost/fusion/sequence/intrinsic/end.hpp>
+
+namespace boost { namespace fusion
+{
+ struct std_tuple_tag;
+
+ namespace extension
+ {
+ template <typename T>
+ struct convert_impl;
+
+ template <>
+ struct convert_impl<std_tuple_tag>
+ {
+ template <typename Sequence>
+ struct apply
+ {
+ typedef detail::build_std_tuple<
+ typename result_of::begin<Sequence>::type
+ , typename result_of::end<Sequence>::type
+ > gen;
+
+ typedef typename gen::type type;
+
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ static type
+ call(Sequence& seq)
+ {
+ return gen::call(begin(seq), end(seq));
+ }
+ };
+ };
+ }
+}}
+
+#endif
diff --git a/boost/fusion/adapted/std_tuple/detail/end_impl.hpp b/boost/fusion/adapted/std_tuple/detail/end_impl.hpp
index 77048698a1..500b0491e5 100644
--- a/boost/fusion/adapted/std_tuple/detail/end_impl.hpp
+++ b/boost/fusion/adapted/std_tuple/detail/end_impl.hpp
@@ -31,7 +31,7 @@ namespace boost { namespace fusion
static int const size = std::tuple_size<seq_type>::value;
typedef std_tuple_iterator<Sequence, size> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Sequence& v)
{
diff --git a/boost/fusion/adapted/std_tuple/mpl/clear.hpp b/boost/fusion/adapted/std_tuple/mpl/clear.hpp
new file mode 100644
index 0000000000..8712316437
--- /dev/null
+++ b/boost/fusion/adapted/std_tuple/mpl/clear.hpp
@@ -0,0 +1,23 @@
+/*=============================================================================
+ Copyright (c) 2012 Kohei Takahashi
+
+ 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)
+==============================================================================*/
+#if !defined(BOOST_FUSION_CLEAR_10172012_0940)
+#define BOOST_FUSION_CLEAR_10172012_0940
+
+#include <boost/mpl/identity.hpp>
+#include <boost/fusion/adapted/std_tuple/tag_of.hpp>
+
+namespace boost { namespace fusion { namespace detail
+{
+ template <typename Tag>
+ struct clear;
+
+ template <>
+ struct clear<std_tuple_tag> : mpl::identity<std::tuple<> > {};
+
+}}}
+
+#endif
diff --git a/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp b/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp
index c4d957ea0b..a3421e0f99 100644
--- a/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp
+++ b/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp
@@ -36,7 +36,8 @@ namespace boost { namespace fusion
typename add_const<Tuple>::type, Index>
identity;
- BOOST_FUSION_GPU_ENABLED explicit std_tuple_iterator(Tuple& tuple)
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ explicit std_tuple_iterator(Tuple& tuple)
: tuple(tuple) {}
Tuple& tuple;
@@ -58,7 +59,7 @@ namespace boost { namespace fusion
>::type
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& iter)
{
@@ -73,7 +74,7 @@ namespace boost { namespace fusion
typedef typename Iterator::tuple_type tuple_type;
typedef std_tuple_iterator<tuple_type, index+N::value> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Iterator const& i)
{
@@ -96,7 +97,7 @@ namespace boost { namespace fusion
{
typedef mpl::int_<Last::index-First::index> type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(First const&, Last const&)
{
@@ -106,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
diff --git a/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/boost/fusion/adapted/struct/adapt_assoc_struct.hpp
index eca77d613b..eab4e1bb6d 100644
--- a/boost/fusion/adapted/struct/adapt_assoc_struct.hpp
+++ b/boost/fusion/adapted/struct/adapt_assoc_struct.hpp
@@ -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) \
diff --git a/boost/fusion/adapted/struct/adapt_struct.hpp b/boost/fusion/adapted/struct/adapt_struct.hpp
index f60ca03e19..e96e7c76d2 100644
--- a/boost/fusion/adapted/struct/adapt_struct.hpp
+++ b/boost/fusion/adapted/struct/adapt_struct.hpp
@@ -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, 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)
-
-#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_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))
+
+
+
+#if BOOST_PP_VARIADICS
+
+# 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
diff --git a/boost/fusion/adapted/struct/adapt_struct_named.hpp b/boost/fusion/adapted/struct/adapt_struct_named.hpp
index 3f29f3a39e..791fb5b0d0 100644
--- a/boost/fusion/adapted/struct/adapt_struct_named.hpp
+++ b/boost/fusion/adapted/struct/adapt_struct_named.hpp
@@ -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
-
-#define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
- WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
+#ifdef BOOST_PP_VARIADICS
+
+# 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_AS_VIEW( \
+ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \
+ (0)NAMESPACE_SEQ)NAME, \
+ __VA_ARGS__)
+
+# 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_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))
-
-#define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
- BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
- WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
+ 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
diff --git a/boost/fusion/adapted/struct/define_assoc_struct.hpp b/boost/fusion/adapted/struct/define_assoc_struct.hpp
index 1f5ce8dca7..f4a3679d73 100644
--- a/boost/fusion/adapted/struct/define_assoc_struct.hpp
+++ b/boost/fusion/adapted/struct/define_assoc_struct.hpp
@@ -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( \
diff --git a/boost/fusion/adapted/struct/define_struct.hpp b/boost/fusion/adapted/struct/define_struct.hpp
index fa1f549f91..2978543672 100644
--- a/boost/fusion/adapted/struct/define_struct.hpp
+++ b/boost/fusion/adapted/struct/define_struct.hpp
@@ -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( \
diff --git a/boost/fusion/adapted/struct/detail/adapt_auto.hpp b/boost/fusion/adapted/struct/detail/adapt_auto.hpp
new file mode 100644
index 0000000000..5178150b4b
--- /dev/null
+++ b/boost/fusion/adapted/struct/detail/adapt_auto.hpp
@@ -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
diff --git a/boost/fusion/adapted/struct/detail/adapt_base.hpp b/boost/fusion/adapted/struct/detail/adapt_base.hpp
index db702ae155..8ec467aed9 100644
--- a/boost/fusion/adapted/struct/detail/adapt_base.hpp
+++ b/boost/fusion/adapted/struct/detail/adapt_base.hpp
@@ -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) \
\
@@ -138,12 +196,13 @@
>::type \
type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type \
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); \
} \
}; \
}; \
@@ -158,12 +217,14 @@
{ \
typedef char const* type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type \
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< \
diff --git a/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp
new file mode 100644
index 0000000000..c75e83c397
--- /dev/null
+++ b/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp
@@ -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
diff --git a/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp b/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp
new file mode 100644
index 0000000000..69d5b204ce
--- /dev/null
+++ b/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp
@@ -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
diff --git a/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp b/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp
new file mode 100644
index 0000000000..2b54a2c0c7
--- /dev/null
+++ b/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp
@@ -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
diff --git a/boost/fusion/adapted/struct/detail/begin_impl.hpp b/boost/fusion/adapted/struct/detail/begin_impl.hpp
index 9cb68719a9..f67df3a724 100644
--- a/boost/fusion/adapted/struct/detail/begin_impl.hpp
+++ b/boost/fusion/adapted/struct/detail/begin_impl.hpp
@@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace extension
>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Seq& seq)
{
@@ -57,7 +57,7 @@ namespace boost { namespace fusion { namespace extension
>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Seq& seq)
{
diff --git a/boost/fusion/adapted/struct/detail/define_struct.hpp b/boost/fusion/adapted/struct/detail/define_struct.hpp
index 44d99f06b4..25542920ad 100644
--- a/boost/fusion/adapted/struct/detail/define_struct.hpp
+++ b/boost/fusion/adapted/struct/detail/define_struct.hpp
@@ -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) \
\
@@ -62,7 +69,7 @@
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
template<typename Seq> \
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
self_type& \
operator=(Seq const& seq) \
{ \
@@ -121,7 +128,7 @@
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ) \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME() \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
@@ -130,7 +137,7 @@
ATTRIBUTES_SEQ) \
{} \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME(self_type const& other_self) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
@@ -140,7 +147,7 @@
{} \
\
template<typename Seq> \
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME(Seq const& seq \
BOOST_PP_IF( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
@@ -160,7 +167,7 @@
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
explicit \
NAME(boost::call_traits< \
BOOST_PP_TUPLE_ELEM( \
@@ -173,7 +180,7 @@
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
explicit \
NAME(typename boost::call_traits< \
typename boost::fusion::detail::get_first_arg< \
@@ -210,7 +217,7 @@
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \
@@ -238,7 +245,7 @@
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \
@@ -280,12 +287,12 @@
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
template<typename Seq> \
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME(Seq const&) \
{} \
\
template<typename Seq> \
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
self_type& \
operator=(Seq const& seq) \
{ \
diff --git a/boost/fusion/adapted/struct/detail/define_struct_inline.hpp b/boost/fusion/adapted/struct/detail/define_struct_inline.hpp
index d720fcf8a5..a5a3ae0628 100644
--- a/boost/fusion/adapted/struct/detail/define_struct_inline.hpp
+++ b/boost/fusion/adapted/struct/detail/define_struct_inline.hpp
@@ -66,6 +66,7 @@
#define BOOST_FUSION_IGNORE_2(ARG1, ARG2)
#define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME(BOOST_PP_SEQ_FOR_EACH_I( \
BOOST_FUSION_MAKE_CONST_REF_PARAM, \
~, \
@@ -113,7 +114,7 @@
struct deref<SPEC_TYPE, N> > \
{ \
typedef typename boost_fusion_detail_Sq::t##N##_type TYPE_QUAL& type; \
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type call(CALL_ARG_TYPE, N> const& iter) \
{ \
return iter.seq_.BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \
@@ -163,7 +164,7 @@
typename boost_fusion_detail_Sq::t##N##_type& \
>::type type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type call(boost_fusion_detail_Sq& sq) \
{ \
return sq. BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \
@@ -208,7 +209,7 @@
result_raw_type \
>::type type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type call(iterator_raw_type const& iter) \
{ \
return boost::fusion::at_c<index>(iter.ref_vec); \
@@ -301,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
@@ -315,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( \
@@ -336,7 +337,7 @@
typedef boost::mpl::int_<N> index; \
typedef boost_fusion_detail_Seq sequence_type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
BOOST_FUSION_ITERATOR_NAME(NAME)(boost_fusion_detail_Seq& seq) \
: seq_(seq) \
BOOST_FUSION_DEFINE_ITERATOR_WKND_INIT_LIST_ENTRIES( \
@@ -359,7 +360,7 @@
boost_fusion_detail_It::index::value + 1 \
> type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type call(boost_fusion_detail_It const& it) \
{ \
return type(it.seq_); \
@@ -374,7 +375,7 @@
boost_fusion_detail_It::index::value - 1 \
> type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type call(boost_fusion_detail_It const& it) \
{ \
return type(it.seq_); \
@@ -392,7 +393,7 @@
typename boost_fusion_detail_It1::index \
>::type type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type call(boost_fusion_detail_It1 const& /* it1 */, \
boost_fusion_detail_It2 const& /* it2 */) \
{ \
@@ -412,7 +413,7 @@
+ boost_fusion_detail_M::value \
> type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type call(boost_fusion_detail_It const& it) \
{ \
return type(it.seq_); \
@@ -445,14 +446,14 @@
(NAME, ATTRIBUTES_SEQ) \
\
template <typename boost_fusion_detail_Seq> \
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME(const boost_fusion_detail_Seq& rhs) \
{ \
boost::fusion::copy(rhs, *this); \
} \
\
template <typename boost_fusion_detail_Seq> \
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME& operator=(const boost_fusion_detail_Seq& rhs) \
{ \
boost::fusion::copy(rhs, *this); \
@@ -465,7 +466,7 @@
typedef BOOST_FUSION_ITERATOR_NAME(NAME)<boost_fusion_detail_Sq, 0> \
type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type call(boost_fusion_detail_Sq& sq) \
{ \
return type(sq); \
@@ -480,7 +481,7 @@
ATTRIBUTES_SEQ_SIZE \
> type; \
\
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
static type call(boost_fusion_detail_Sq& sq) \
{ \
return type(sq); \
diff --git a/boost/fusion/adapted/struct/detail/deref_impl.hpp b/boost/fusion/adapted/struct/detail/deref_impl.hpp
index a3bc9f3e19..c53b51a320 100644
--- a/boost/fusion/adapted/struct/detail/deref_impl.hpp
+++ b/boost/fusion/adapted/struct/detail/deref_impl.hpp
@@ -28,9 +28,8 @@ namespace boost { namespace fusion { namespace extension
typedef typename impl::type type;
- BOOST_FUSION_GPU_ENABLED
- static
- type
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
+ static type
call(It const& it)
{
return impl::call(*it.seq);
diff --git a/boost/fusion/adapted/struct/detail/end_impl.hpp b/boost/fusion/adapted/struct/detail/end_impl.hpp
index b17eba7139..855be7a4ee 100644
--- a/boost/fusion/adapted/struct/detail/end_impl.hpp
+++ b/boost/fusion/adapted/struct/detail/end_impl.hpp
@@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace extension
>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Seq& seq)
{
@@ -57,7 +57,7 @@ namespace boost { namespace fusion { namespace extension
>
type;
- BOOST_FUSION_GPU_ENABLED
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type
call(Seq& seq)
{
diff --git a/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp b/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp
new file mode 100644
index 0000000000..95f110509b
--- /dev/null
+++ b/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp
@@ -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
diff --git a/boost/fusion/adapted/struct/detail/proxy_type.hpp b/boost/fusion/adapted/struct/detail/proxy_type.hpp
index 350137a482..b4cb55bb4a 100644
--- a/boost/fusion/adapted/struct/detail/proxy_type.hpp
+++ b/boost/fusion/adapted/struct/detail/proxy_type.hpp
@@ -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) \
\
@@ -19,7 +21,7 @@
\
struct NAME \
{ \
- BOOST_FUSION_GPU_ENABLED \
+ BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
NAME(WRAPPED_TYPE& in_obj) \
: obj(in_obj) \
{} \