forked from boostorg/fusion
Fusion: merge from trunk
[SVN r65735]
This commit is contained in:
@ -7,12 +7,12 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_HPP
|
||||
#ifndef BOOST_FUSION_ADAPTED_ADT_HPP
|
||||
#define BOOST_FUSION_ADAPTED_ADT_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class_named.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_class_named.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_class.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt_named.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt_named.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
|
||||
|
||||
#endif
|
@ -7,8 +7,8 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_HPP
|
||||
#ifndef BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_HPP
|
||||
#define BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_HPP
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
@ -29,46 +29,46 @@
|
||||
#include <boost/fusion/adapted/struct/detail/end_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/adapt_base.hpp>
|
||||
#include <boost/fusion/adapted/adt/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/adt/detail/adapt_base.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_FILLER_0(A, B, C, D)\
|
||||
((A, B, C, D)) BOOST_FUSION_ADAPT_CLASS_FILLER_1
|
||||
#define BOOST_FUSION_ADAPT_CLASS_FILLER_1(A, B, C, D)\
|
||||
((A, B, C, D)) BOOST_FUSION_ADAPT_CLASS_FILLER_0
|
||||
#define BOOST_FUSION_ADAPT_CLASS_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_CLASS_FILLER_1_END
|
||||
#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_CLASS_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
|
||||
BOOST_FUSION_ADAPT_CLASS_C_BASE( \
|
||||
#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_TPL_CLASS(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES)\
|
||||
#define BOOST_FUSION_ADAPT_TPL_ADT(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_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_CLASS_C)
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ADT_C)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS(NAME, ATTRIBUTES) \
|
||||
#define BOOST_FUSION_ADAPT_ADT(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_CLASS_C)
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ADT_C)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_AS_VIEW(NAME, ATTRIBUTES) \
|
||||
#define BOOST_FUSION_ADAPT_ADT_AS_VIEW(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
1, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_CLASS_C)
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ADT_C)
|
||||
|
||||
|
||||
#endif
|
@ -7,24 +7,24 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_NAMED_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_NAMED_HPP
|
||||
#ifndef BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_NAMED_HPP
|
||||
#define BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_NAMED_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_class.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_NAMED_NS( \
|
||||
#define BOOST_FUSION_ADAPT_ADT_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_CLASS_AS_VIEW( \
|
||||
BOOST_FUSION_ADAPT_ADT_AS_VIEW( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
|
||||
ATTRIBUTES)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_CLASS_NAMED_NS( \
|
||||
#define BOOST_FUSION_ADAPT_ADT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_ADT_NAMED_NS( \
|
||||
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
|
||||
|
||||
#endif
|
@ -7,8 +7,8 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_HPP
|
||||
#ifndef BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_HPP
|
||||
#define BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_HPP
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
@ -32,20 +32,20 @@
|
||||
#include <boost/fusion/adapted/struct/detail/deref_data_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/key_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_of_data_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/adapt_base.hpp>
|
||||
#include <boost/fusion/adapted/adt/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/adt/detail/adapt_base.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0(A, B, C, D, E)\
|
||||
((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1(A, B, C, D, E)\
|
||||
((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1_END
|
||||
#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
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_C( \
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_C( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_CLASS_C_BASE(TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,5) \
|
||||
BOOST_FUSION_ADAPT_ADT_C_BASE(TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,5) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
@ -55,7 +55,7 @@
|
||||
typedef BOOST_PP_TUPLE_ELEM(5, 4, ATTRIBUTE) type; \
|
||||
};
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_TPL_CLASS( \
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
@ -63,25 +63,25 @@
|
||||
(1)NAME_SEQ, \
|
||||
assoc_struct_tag, \
|
||||
0, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_C)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS(NAME, ATTRIBUTES) \
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
assoc_struct_tag, \
|
||||
0, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_C)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_AS_VIEW(NAME, ATTRIBUTES) \
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_AS_VIEW(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
assoc_struct_tag, \
|
||||
1, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_C)
|
||||
|
||||
#endif
|
@ -5,24 +5,24 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_NAMED_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_NAMED_HPP
|
||||
#ifndef BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_NAMED_HPP
|
||||
#define BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_NAMED_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
|
||||
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS( \
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_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_ASSOC_CLASS_AS_VIEW( \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_AS_VIEW( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
|
||||
ATTRIBUTES)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS( \
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED_NS( \
|
||||
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
|
||||
|
||||
#endif
|
181
include/boost/fusion/adapted/adt/detail/adapt_base.hpp
Normal file
181
include/boost/fusion/adapted/adt/detail/adapt_base.hpp
Normal file
@ -0,0 +1,181 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
Copyright (c) 2010 Christopher Schmidt
|
||||
|
||||
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_HPP
|
||||
#define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_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>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ) \
|
||||
typename detail::get_identity< \
|
||||
lvalue \
|
||||
, BOOST_PP_SEQ_ELEM(1,TEMPLATE_PARAMS_SEQ) \
|
||||
>::type
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_NON_TEMPLATE_IMPL( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
remove_const<remove_reference<T>::type>::type
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ADT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct access::adt_attribute_access< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
> \
|
||||
{ \
|
||||
template<class Arg> \
|
||||
static void \
|
||||
boost_fusion_adapt_adt_impl_set( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj, \
|
||||
Arg const& val) \
|
||||
{ \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \
|
||||
} \
|
||||
\
|
||||
static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
|
||||
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); \
|
||||
} \
|
||||
\
|
||||
static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
|
||||
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); \
|
||||
} \
|
||||
}; \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct adt_attribute_proxy< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
, true \
|
||||
> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) type; \
|
||||
\
|
||||
explicit \
|
||||
adt_attribute_proxy( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const*const o) \
|
||||
: obj(o) \
|
||||
{} \
|
||||
\
|
||||
type get() const \
|
||||
{ \
|
||||
return access::adt_attribute_access< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
>::boost_fusion_adapt_adt_impl_get(*obj); \
|
||||
} \
|
||||
\
|
||||
operator type() const \
|
||||
{ \
|
||||
return get(); \
|
||||
} \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const* obj; \
|
||||
}; \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct adt_attribute_proxy< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
, false \
|
||||
> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
|
||||
\
|
||||
explicit \
|
||||
adt_attribute_proxy( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)*const o) \
|
||||
: obj(o) \
|
||||
{} \
|
||||
\
|
||||
template<class Arg> \
|
||||
adt_attribute_proxy& \
|
||||
operator=(Arg const& val) \
|
||||
{ \
|
||||
access::adt_attribute_access< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
>::boost_fusion_adapt_adt_impl_set(*obj, val); \
|
||||
return *this; \
|
||||
} \
|
||||
\
|
||||
type get() const \
|
||||
{ \
|
||||
return access::adt_attribute_access< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
>::boost_fusion_adapt_adt_impl_get(*obj); \
|
||||
} \
|
||||
\
|
||||
operator type() const \
|
||||
{ \
|
||||
return get(); \
|
||||
} \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)* obj; \
|
||||
}; \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct access::struct_member< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \
|
||||
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
typedef \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), \
|
||||
BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_TEMPLATE_IMPL, \
|
||||
BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_NON_TEMPLATE_IMPL)( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
type; \
|
||||
\
|
||||
template<typename Seq> \
|
||||
struct apply \
|
||||
{ \
|
||||
typedef \
|
||||
adt_attribute_proxy< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
, is_const<Seq>::value \
|
||||
> \
|
||||
type; \
|
||||
\
|
||||
static type \
|
||||
call(Seq& obj) \
|
||||
{ \
|
||||
return type(&obj); \
|
||||
} \
|
||||
}; \
|
||||
};
|
||||
|
||||
#endif
|
@ -7,27 +7,18 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_DETAIL_EXTENSION_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_DETAIL_EXTENSION_HPP
|
||||
#ifndef BOOST_FUSION_ADAPTED_ADT_DETAIL_EXTENSION_HPP
|
||||
#define BOOST_FUSION_ADAPTED_ADT_DETAIL_EXTENSION_HPP
|
||||
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T, typename Dummy>
|
||||
struct get_identity
|
||||
: remove_const<typename remove_reference<T>::type>
|
||||
{};
|
||||
}
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename T, int N>
|
||||
struct class_member_proxy;
|
||||
}
|
||||
}}
|
||||
template <typename T, typename Dummy>
|
||||
struct get_identity
|
||||
: remove_const<typename remove_reference<T>::type>
|
||||
{};
|
||||
}}}
|
||||
|
||||
#endif
|
@ -1,118 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
Copyright (c) 2010 Christopher Schmidt
|
||||
|
||||
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_CLASS_DETAIL_ADAPT_BASE_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_DETAIL_ADAPT_BASE_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>
|
||||
|
||||
//cschmidt: Spirit relies on Fusion defining class_member_proxy in the
|
||||
//boost::fusion::extension namespace, with two nested types named lvalue and
|
||||
//rvalue.
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ)\
|
||||
typename detail::get_identity< \
|
||||
lvalue \
|
||||
, BOOST_PP_SEQ_ELEM(1,TEMPLATE_PARAMS_SEQ) \
|
||||
>::type
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_NON_TEMPLATE_IMPL( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
lvalue
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_C_BASE(\
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct class_member_proxy< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) rvalue; \
|
||||
\
|
||||
class_member_proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& o) \
|
||||
: obj(o) \
|
||||
{} \
|
||||
\
|
||||
template<class Arg> \
|
||||
class_member_proxy& \
|
||||
operator=(Arg const& val) \
|
||||
{ \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \
|
||||
return *this; \
|
||||
} \
|
||||
\
|
||||
operator lvalue() \
|
||||
{ \
|
||||
return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
|
||||
} \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
|
||||
\
|
||||
private: \
|
||||
class_member_proxy& operator= (class_member_proxy const&); \
|
||||
}; \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct struct_member<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \
|
||||
\
|
||||
typedef \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), \
|
||||
BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_TEMPLATE_IMPL, \
|
||||
BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_NON_TEMPLATE_IMPL)( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
type; \
|
||||
\
|
||||
template<typename Seq> \
|
||||
struct apply \
|
||||
{ \
|
||||
typedef \
|
||||
class_member_proxy< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
> \
|
||||
proxy; \
|
||||
\
|
||||
typedef typename \
|
||||
mpl::if_< \
|
||||
is_const<Seq> \
|
||||
, BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
|
||||
, proxy \
|
||||
>::type \
|
||||
type; \
|
||||
\
|
||||
static proxy \
|
||||
call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \
|
||||
{ \
|
||||
return proxy(obj); \
|
||||
} \
|
||||
\
|
||||
static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
|
||||
call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \
|
||||
{ \
|
||||
return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
|
||||
} \
|
||||
}; \
|
||||
};
|
||||
|
||||
#endif
|
@ -87,15 +87,41 @@
|
||||
I, \
|
||||
ATTRIBUTE)
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM(R,_,ELEM) \
|
||||
typedef ELEM ELEM;
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL(SEQ) \
|
||||
BOOST_PP_SEQ_FOR_EACH( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAM, \
|
||||
_, \
|
||||
BOOST_PP_SEQ_TAIL(SEQ))
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS(SEQ) \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_SEQ_HEAD(SEQ), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS_IMPL, \
|
||||
BOOST_PP_TUPLE_EAT(1))(SEQ)
|
||||
#else
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS(SEQ)
|
||||
#endif
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct struct_member<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
|
||||
struct access::struct_member< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
|
||||
typedef \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
|
||||
attribute_type; \
|
||||
BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
typedef attribute_type type; \
|
||||
\
|
||||
template<typename Seq> \
|
||||
struct apply \
|
||||
@ -104,12 +130,8 @@
|
||||
add_reference< \
|
||||
typename mpl::eval_if< \
|
||||
is_const<Seq> \
|
||||
, add_const<BOOST_PP_TUPLE_ELEM( \
|
||||
ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
|
||||
> \
|
||||
, mpl::identity<BOOST_PP_TUPLE_ELEM( \
|
||||
ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
|
||||
> \
|
||||
, add_const<attribute_type> \
|
||||
, mpl::identity<attribute_type> \
|
||||
>::type \
|
||||
>::type \
|
||||
type; \
|
||||
|
@ -22,7 +22,7 @@ namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename Seq, typename N>
|
||||
struct apply
|
||||
: extension::struct_member<
|
||||
: access::struct_member<
|
||||
typename remove_const<Seq>::type
|
||||
, N::value
|
||||
>::template apply<Seq>
|
||||
|
@ -20,7 +20,7 @@ namespace boost { namespace fusion { namespace extension
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
extension::struct_member<
|
||||
access::struct_member<
|
||||
typename remove_const<typename It::seq_type>::type
|
||||
, It::index::value
|
||||
>::template apply<typename It::seq_type>
|
||||
|
@ -27,8 +27,17 @@ namespace boost { namespace fusion
|
||||
{
|
||||
struct no_such_member;
|
||||
|
||||
template<typename Seq, int N>
|
||||
struct struct_member;
|
||||
struct access
|
||||
{
|
||||
template<typename Seq, int N>
|
||||
struct struct_member;
|
||||
|
||||
template<typename Seq, int N>
|
||||
struct adt_attribute_access;
|
||||
};
|
||||
|
||||
template <typename T, int N, bool Const>
|
||||
struct adt_attribute_proxy;
|
||||
|
||||
template<typename Seq, int N>
|
||||
struct struct_member_name;
|
||||
|
@ -20,7 +20,7 @@ namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename Seq, typename N>
|
||||
struct apply
|
||||
: struct_member<typename remove_const<Seq>::type, N::value>
|
||||
: access::struct_member<typename remove_const<Seq>::type, N::value>
|
||||
{};
|
||||
};
|
||||
|
||||
|
@ -18,7 +18,7 @@ namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename It>
|
||||
struct apply
|
||||
: extension::struct_member<
|
||||
: access::struct_member<
|
||||
typename remove_const<typename It::seq_type>::type
|
||||
, It::index::value
|
||||
>
|
||||
|
Reference in New Issue
Block a user