mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-23 17:17:23 +02:00
better adapt structs/classes implementation
[SVN r59913]
This commit is contained in:
@ -1,4 +1,6 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
|
Copyright (c) 2001-2009 Joel de Guzman
|
||||||
|
Copyright (c) 2007 Dan Marsden
|
||||||
Copyright (c) 2010 Christopher Schmidt
|
Copyright (c) 2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
@ -11,22 +13,27 @@
|
|||||||
#include <boost/preprocessor/cat.hpp>
|
#include <boost/preprocessor/cat.hpp>
|
||||||
#include <boost/preprocessor/empty.hpp>
|
#include <boost/preprocessor/empty.hpp>
|
||||||
#include <boost/preprocessor/tuple/elem.hpp>
|
#include <boost/preprocessor/tuple/elem.hpp>
|
||||||
|
#include <boost/type_traits/add_reference.hpp>
|
||||||
|
#include <boost/type_traits/is_const.hpp>
|
||||||
|
#include <boost/type_traits/remove_const.hpp>
|
||||||
|
|
||||||
|
#include <boost/fusion/adapted/struct/detail/extension.hpp>
|
||||||
|
#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/is_sequence_impl.hpp>
|
||||||
|
#include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
||||||
|
#include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
|
||||||
|
#include <boost/fusion/adapted/struct/detail/size_impl.hpp>
|
||||||
|
#include <boost/fusion/adapted/struct/detail/begin_impl.hpp>
|
||||||
|
#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/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/extension.hpp>
|
||||||
#include <boost/fusion/adapted/class/detail/adapt_base.hpp>
|
#include <boost/fusion/adapted/class/detail/adapt_base.hpp>
|
||||||
#include <boost/fusion/adapted/class/detail/at_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/is_view_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/is_sequence_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/value_at_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/category_of_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/size_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/begin_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/end_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/value_of_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/deref_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/deref_data_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/key_of_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/value_of_data_impl.hpp>
|
|
||||||
|
|
||||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0(A, B, C, D, E)\
|
#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
|
((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1
|
||||||
@ -54,7 +61,7 @@
|
|||||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||||
(1)TEMPLATE_PARAMS_SEQ, \
|
(1)TEMPLATE_PARAMS_SEQ, \
|
||||||
(1)NAME_SEQ, \
|
(1)NAME_SEQ, \
|
||||||
assoc_class_tag, \
|
assoc_struct_tag, \
|
||||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||||
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
|
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
|
||||||
|
|
||||||
@ -62,7 +69,7 @@
|
|||||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||||
(0), \
|
(0), \
|
||||||
(0)(NAME), \
|
(0)(NAME), \
|
||||||
assoc_class_tag, \
|
assoc_struct_tag, \
|
||||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||||
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
|
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
|
Copyright (c) 2001-2009 Joel de Guzman
|
||||||
|
Copyright (c) 2009-2010 Hartmut Kaiser
|
||||||
Copyright (c) 2010 Christopher Schmidt
|
Copyright (c) 2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
@ -10,19 +12,25 @@
|
|||||||
|
|
||||||
#include <boost/preprocessor/cat.hpp>
|
#include <boost/preprocessor/cat.hpp>
|
||||||
#include <boost/preprocessor/empty.hpp>
|
#include <boost/preprocessor/empty.hpp>
|
||||||
|
#include <boost/type_traits/add_reference.hpp>
|
||||||
|
#include <boost/type_traits/is_const.hpp>
|
||||||
|
#include <boost/type_traits/add_const.hpp>
|
||||||
|
#include <boost/type_traits/remove_const.hpp>
|
||||||
|
|
||||||
|
#include <boost/fusion/adapted/struct/detail/extension.hpp>
|
||||||
|
#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/is_sequence_impl.hpp>
|
||||||
|
#include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
||||||
|
#include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
|
||||||
|
#include <boost/fusion/adapted/struct/detail/size_impl.hpp>
|
||||||
|
#include <boost/fusion/adapted/struct/detail/begin_impl.hpp>
|
||||||
|
#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/extension.hpp>
|
||||||
#include <boost/fusion/adapted/class/detail/adapt_base.hpp>
|
#include <boost/fusion/adapted/class/detail/adapt_base.hpp>
|
||||||
#include <boost/fusion/adapted/class/detail/at_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/is_view_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/is_sequence_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/value_at_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/category_of_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/size_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/begin_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/end_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/value_of_impl.hpp>
|
|
||||||
#include <boost/fusion/adapted/class/detail/deref_impl.hpp>
|
|
||||||
|
|
||||||
#define BOOST_FUSION_ADAPT_CLASS_FILLER_0(A, B, C, D)\
|
#define BOOST_FUSION_ADAPT_CLASS_FILLER_0(A, B, C, D)\
|
||||||
((A, B, C, D)) BOOST_FUSION_ADAPT_CLASS_FILLER_1
|
((A, B, C, D)) BOOST_FUSION_ADAPT_CLASS_FILLER_1
|
||||||
@ -39,7 +47,7 @@
|
|||||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||||
(1)TEMPLATE_PARAMS_SEQ, \
|
(1)TEMPLATE_PARAMS_SEQ, \
|
||||||
(1)NAME_SEQ, \
|
(1)NAME_SEQ, \
|
||||||
class_tag, \
|
struct_tag, \
|
||||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||||
BOOST_FUSION_ADAPT_CLASS_C)
|
BOOST_FUSION_ADAPT_CLASS_C)
|
||||||
|
|
||||||
@ -47,7 +55,7 @@
|
|||||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||||
(0), \
|
(0), \
|
||||||
(0)(NAME), \
|
(0)(NAME), \
|
||||||
class_tag, \
|
struct_tag, \
|
||||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||||
BOOST_FUSION_ADAPT_CLASS_C)
|
BOOST_FUSION_ADAPT_CLASS_C)
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
|
Copyright (c) 2001-2009 Joel de Guzman
|
||||||
|
Copyright (c) 2009-2010 Hartmut Kaiser
|
||||||
Copyright (c) 2010 Christopher Schmidt
|
Copyright (c) 2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
@ -1,14 +1,35 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
|
Copyright (c) 2001-2009 Joel de Guzman
|
||||||
|
Copyright (c) 2005-2006 Dan Marsden
|
||||||
Copyright (c) 2010 Christopher Schmidt
|
Copyright (c) 2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_CLASS_ADAPT_BASE_HPP
|
#ifndef BOOST_FUSION_ADAPTED_CLASS_DETAIL_ADAPT_BASE_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_ADAPT_BASE_HPP
|
#define BOOST_FUSION_ADAPTED_CLASS_DETAIL_ADAPT_BASE_HPP
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/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(\
|
#define BOOST_FUSION_ADAPT_CLASS_C_BASE(\
|
||||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
|
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
|
||||||
@ -21,9 +42,8 @@
|
|||||||
, I \
|
, I \
|
||||||
> \
|
> \
|
||||||
{ \
|
{ \
|
||||||
typedef \
|
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \
|
||||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
|
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) rvalue; \
|
||||||
type; \
|
|
||||||
\
|
\
|
||||||
class_member_proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj)\
|
class_member_proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj)\
|
||||||
: obj(obj) \
|
: obj(obj) \
|
||||||
@ -31,13 +51,13 @@
|
|||||||
\
|
\
|
||||||
template<class Arg> \
|
template<class Arg> \
|
||||||
class_member_proxy& \
|
class_member_proxy& \
|
||||||
operator=(Arg val) \
|
operator=(Arg const& val) \
|
||||||
{ \
|
{ \
|
||||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \
|
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \
|
||||||
return *this; \
|
return *this; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
operator type() \
|
operator lvalue() \
|
||||||
{ \
|
{ \
|
||||||
return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
|
return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
|
||||||
} \
|
} \
|
||||||
@ -50,34 +70,46 @@
|
|||||||
> \
|
> \
|
||||||
struct struct_member<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
|
struct 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) lvalue; \
|
||||||
typedef \
|
|
||||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
|
|
||||||
get_type; \
|
|
||||||
typedef \
|
|
||||||
class_member_proxy< \
|
|
||||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
|
||||||
, I \
|
|
||||||
> \
|
|
||||||
proxy; \
|
|
||||||
\
|
\
|
||||||
static get_type \
|
typedef \
|
||||||
call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \
|
BOOST_PP_IF( \
|
||||||
{ \
|
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), \
|
||||||
return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
|
BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_TEMPLATE_IMPL, \
|
||||||
}; \
|
BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_NON_TEMPLATE_IMPL)( \
|
||||||
|
TEMPLATE_PARAMS_SEQ) \
|
||||||
|
type; \
|
||||||
\
|
\
|
||||||
static proxy \
|
template<typename Seq> \
|
||||||
call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \
|
struct apply \
|
||||||
{ \
|
{ \
|
||||||
return proxy(obj); \
|
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); \
|
||||||
|
} \
|
||||||
}; \
|
}; \
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template <typename T, int N>
|
|
||||||
struct class_member_proxy;
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_AT_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_AT_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/mpl/if.hpp>
|
|
||||||
#include <boost/type_traits/is_const.hpp>
|
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template<typename>
|
|
||||||
struct at_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct at_impl<class_tag>
|
|
||||||
{
|
|
||||||
template<typename Seq, typename N>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
typedef
|
|
||||||
extension::struct_member<
|
|
||||||
typename remove_const<Seq>::type
|
|
||||||
, N::value
|
|
||||||
>
|
|
||||||
member;
|
|
||||||
|
|
||||||
typedef typename
|
|
||||||
mpl::if_<
|
|
||||||
is_const<Seq>
|
|
||||||
, typename member::get_type
|
|
||||||
, typename member::proxy
|
|
||||||
>::type
|
|
||||||
type;
|
|
||||||
|
|
||||||
static type
|
|
||||||
call(Seq& seq)
|
|
||||||
{
|
|
||||||
return member::call(seq);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct at_impl<assoc_class_tag>
|
|
||||||
: at_impl<class_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,65 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_BEGIN_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_BEGIN_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/iterator/basic_iterator.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template<typename>
|
|
||||||
struct begin_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct begin_impl<class_tag>
|
|
||||||
{
|
|
||||||
template <typename Seq>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
typedef
|
|
||||||
basic_iterator<
|
|
||||||
class_iterator_tag
|
|
||||||
, random_access_traversal_tag
|
|
||||||
, Seq
|
|
||||||
, 0
|
|
||||||
>
|
|
||||||
type;
|
|
||||||
|
|
||||||
static type
|
|
||||||
call(Seq& seq)
|
|
||||||
{
|
|
||||||
return type(seq,0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct begin_impl<assoc_class_tag>
|
|
||||||
{
|
|
||||||
template <typename Seq>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
typedef
|
|
||||||
basic_iterator<
|
|
||||||
assoc_class_iterator_tag
|
|
||||||
, assoc_class_category
|
|
||||||
, Seq
|
|
||||||
, 0
|
|
||||||
>
|
|
||||||
type;
|
|
||||||
|
|
||||||
static type
|
|
||||||
call(Seq& seq)
|
|
||||||
{
|
|
||||||
return type(seq,0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,32 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_CATEGORY_OF_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_CATEGORY_OF_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion
|
|
||||||
{
|
|
||||||
namespace extension
|
|
||||||
{
|
|
||||||
template<typename>
|
|
||||||
struct category_of_impl;
|
|
||||||
|
|
||||||
template<>
|
|
||||||
struct category_of_impl<class_tag>
|
|
||||||
: category_of_impl<struct_tag>
|
|
||||||
{};
|
|
||||||
|
|
||||||
template<>
|
|
||||||
struct category_of_impl<assoc_class_tag>
|
|
||||||
: category_of_impl<assoc_struct_tag>
|
|
||||||
{};
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,22 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_DEREF_DATA_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_DEREF_DATA_IMPL_HPP
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template <typename>
|
|
||||||
struct deref_data_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct deref_data_impl<assoc_class_iterator_tag>
|
|
||||||
: deref_impl<assoc_class_iterator_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,55 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_DEREF_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_DEREF_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/mpl/if.hpp>
|
|
||||||
#include <boost/type_traits/is_const.hpp>
|
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template <typename>
|
|
||||||
struct deref_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct deref_impl<class_iterator_tag>
|
|
||||||
{
|
|
||||||
template <typename It>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
typedef
|
|
||||||
extension::struct_member<
|
|
||||||
typename remove_const<typename It::seq_type>::type
|
|
||||||
, It::index::value
|
|
||||||
>
|
|
||||||
member;
|
|
||||||
|
|
||||||
typedef typename
|
|
||||||
mpl::if_<
|
|
||||||
is_const<typename It::seq_type>
|
|
||||||
, typename member::get_type
|
|
||||||
, typename member::proxy
|
|
||||||
>::type
|
|
||||||
type;
|
|
||||||
|
|
||||||
static type
|
|
||||||
call(It const& it)
|
|
||||||
{
|
|
||||||
return member::call(*it.seq);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct deref_impl<assoc_class_iterator_tag>
|
|
||||||
: deref_impl<class_iterator_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,66 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_END_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_END_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/iterator/basic_iterator.hpp>
|
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template <typename>
|
|
||||||
struct end_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct end_impl<class_tag>
|
|
||||||
{
|
|
||||||
template <typename Seq>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
typedef
|
|
||||||
basic_iterator<
|
|
||||||
class_iterator_tag
|
|
||||||
, random_access_traversal_tag
|
|
||||||
, Seq
|
|
||||||
, struct_size<typename remove_const<Seq>::type>::value
|
|
||||||
>
|
|
||||||
type;
|
|
||||||
|
|
||||||
static type
|
|
||||||
call(Seq& seq)
|
|
||||||
{
|
|
||||||
return type(seq,0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct end_impl<assoc_class_tag>
|
|
||||||
{
|
|
||||||
template <typename Seq>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
typedef
|
|
||||||
basic_iterator<
|
|
||||||
assoc_class_iterator_tag
|
|
||||||
, assoc_class_category
|
|
||||||
, Seq
|
|
||||||
, struct_size<typename remove_const<Seq>::type>::value
|
|
||||||
>
|
|
||||||
type;
|
|
||||||
|
|
||||||
static type
|
|
||||||
call(Seq& seq)
|
|
||||||
{
|
|
||||||
return type(seq,0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,23 +1,33 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
|
Copyright (c) 2001-2009 Joel de Guzman
|
||||||
|
Copyright (c) 2005-2006 Dan Marsden
|
||||||
Copyright (c) 2010 Christopher Schmidt
|
Copyright (c) 2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_CLASS_EXTENSION_HPP
|
#ifndef BOOST_FUSION_ADAPTED_CLASS_DETAIL_EXTENSION_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_EXTENSION_HPP
|
#define BOOST_FUSION_ADAPTED_CLASS_DETAIL_EXTENSION_HPP
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/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
|
||||||
{
|
{
|
||||||
struct class_tag;
|
namespace detail
|
||||||
struct class_iterator_tag;
|
{
|
||||||
struct assoc_class_tag;
|
template <typename T, typename Dummy>
|
||||||
struct assoc_class_iterator_tag;
|
struct get_identity
|
||||||
|
: remove_const<typename remove_reference<T>::type>
|
||||||
|
{};
|
||||||
|
}
|
||||||
|
|
||||||
typedef assoc_struct_category assoc_class_category;
|
namespace extension
|
||||||
|
{
|
||||||
|
template <typename T, int N>
|
||||||
|
struct class_member_proxy;
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_IS_SEQUENCE_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_IS_SEQUENCE_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template<typename>
|
|
||||||
struct is_sequence_impl;
|
|
||||||
|
|
||||||
template<>
|
|
||||||
struct is_sequence_impl<class_tag>
|
|
||||||
: is_sequence_impl<struct_tag>
|
|
||||||
{};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct is_sequence_impl<assoc_class_tag>
|
|
||||||
: is_sequence_impl<assoc_struct_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,29 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_IS_VIEW_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_IS_VIEW_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template<typename>
|
|
||||||
struct is_view_impl;
|
|
||||||
|
|
||||||
template<>
|
|
||||||
struct is_view_impl<class_tag>
|
|
||||||
: is_view_impl<struct_tag>
|
|
||||||
{};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct is_view_impl<assoc_class_tag>
|
|
||||||
: is_view_impl<assoc_struct_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,24 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_KEY_OF_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_KEY_OF_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/key_of_impl.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template <typename>
|
|
||||||
struct key_of_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct key_of_impl<assoc_class_iterator_tag>
|
|
||||||
: key_of_impl<assoc_struct_iterator_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,29 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_SIZE_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_SIZE_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/size_impl.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template<typename>
|
|
||||||
struct size_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct size_impl<class_tag>
|
|
||||||
: size_impl<struct_tag>
|
|
||||||
{};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct size_impl<assoc_class_tag>
|
|
||||||
: size_impl<assoc_struct_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,29 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_VALUE_AT_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_VALUE_AT_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template<typename>
|
|
||||||
struct value_at_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct value_at_impl<class_tag>
|
|
||||||
: value_at_impl<struct_tag>
|
|
||||||
{};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct value_at_impl<assoc_class_tag>
|
|
||||||
: value_at_impl<assoc_struct_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,24 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_VALUE_OF_DATA_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_VALUE_OF_DATA_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/value_of_data_impl.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template <typename>
|
|
||||||
struct value_of_data_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct value_of_data_impl<assoc_class_iterator_tag>
|
|
||||||
: value_of_data_impl<assoc_struct_iterator_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,29 +0,0 @@
|
|||||||
/*=============================================================================
|
|
||||||
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_DETAIL_CLASS_VALUE_OF_IMPL_HPP
|
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_CLASS_VALUE_OF_IMPL_HPP
|
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
|
||||||
{
|
|
||||||
template <typename>
|
|
||||||
struct value_of_impl;
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct value_of_impl<class_iterator_tag>
|
|
||||||
: value_of_impl<struct_iterator_tag>
|
|
||||||
{};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
struct value_of_impl<assoc_class_iterator_tag>
|
|
||||||
: value_of_impl<class_iterator_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
|
||||||
|
|
||||||
#endif
|
|
@ -13,6 +13,10 @@
|
|||||||
#include <boost/preprocessor/cat.hpp>
|
#include <boost/preprocessor/cat.hpp>
|
||||||
#include <boost/preprocessor/empty.hpp>
|
#include <boost/preprocessor/empty.hpp>
|
||||||
#include <boost/preprocessor/tuple/elem.hpp>
|
#include <boost/preprocessor/tuple/elem.hpp>
|
||||||
|
#include <boost/type_traits/add_reference.hpp>
|
||||||
|
#include <boost/type_traits/is_const.hpp>
|
||||||
|
#include <boost/type_traits/add_const.hpp>
|
||||||
|
#include <boost/type_traits/remove_const.hpp>
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/extension.hpp>
|
#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.hpp>
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
|
|
||||||
#include <boost/preprocessor/cat.hpp>
|
#include <boost/preprocessor/cat.hpp>
|
||||||
#include <boost/preprocessor/empty.hpp>
|
#include <boost/preprocessor/empty.hpp>
|
||||||
|
#include <boost/type_traits/add_reference.hpp>
|
||||||
|
#include <boost/type_traits/is_const.hpp>
|
||||||
|
#include <boost/type_traits/add_const.hpp>
|
||||||
|
#include <boost/type_traits/remove_const.hpp>
|
||||||
|
|
||||||
#include <boost/fusion/adapted/struct/detail/extension.hpp>
|
#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.hpp>
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
|
Copyright (c) 2001-2007 Joel de Guzman
|
||||||
|
Copyright (c) 2009-2010 Hartmut Kaiser
|
||||||
Copyright (c) 2010 Christopher Schmidt
|
Copyright (c) 2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
@ -1,16 +1,20 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
|
Copyright (c) 2001-2009 Joel de Guzman
|
||||||
|
Copyright (c) 2005-2006 Dan Marsden
|
||||||
Copyright (c) 2009-2010 Christopher Schmidt
|
Copyright (c) 2009-2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_ADAPT_BASE_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_ADAPT_BASE_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_HPP
|
||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||||
|
|
||||||
|
#include <boost/preprocessor/empty.hpp>
|
||||||
|
#include <boost/preprocessor/stringize.hpp>
|
||||||
#include <boost/preprocessor/control/if.hpp>
|
#include <boost/preprocessor/control/if.hpp>
|
||||||
#include <boost/preprocessor/seq/size.hpp>
|
#include <boost/preprocessor/seq/size.hpp>
|
||||||
#include <boost/preprocessor/seq/for_each.hpp>
|
#include <boost/preprocessor/seq/for_each.hpp>
|
||||||
@ -20,11 +24,14 @@
|
|||||||
#include <boost/preprocessor/tuple/eat.hpp>
|
#include <boost/preprocessor/tuple/eat.hpp>
|
||||||
#include <boost/preprocessor/tuple/elem.hpp>
|
#include <boost/preprocessor/tuple/elem.hpp>
|
||||||
#include <boost/mpl/tag.hpp>
|
#include <boost/mpl/tag.hpp>
|
||||||
#include <boost/type_traits/add_reference.hpp>
|
#include <boost/mpl/eval_if.hpp>
|
||||||
|
#include <boost/mpl/identity.hpp>
|
||||||
#include <boost/type_traits/add_const.hpp>
|
#include <boost/type_traits/add_const.hpp>
|
||||||
|
|
||||||
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \
|
#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_SEQ_HEAD(SEQ)<BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TAIL(SEQ))> \
|
||||||
|
BOOST_PP_EMPTY()
|
||||||
|
|
||||||
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(SEQ) \
|
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(SEQ) \
|
||||||
BOOST_PP_IF( \
|
BOOST_PP_IF( \
|
||||||
BOOST_PP_SEQ_HEAD(SEQ), \
|
BOOST_PP_SEQ_HEAD(SEQ), \
|
||||||
@ -47,7 +54,7 @@
|
|||||||
|
|
||||||
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
|
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
|
||||||
# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
|
# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
|
||||||
MODIFIER, TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG) \
|
MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
|
||||||
\
|
\
|
||||||
template< \
|
template< \
|
||||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||||
@ -61,7 +68,7 @@
|
|||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
|
# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
|
||||||
MODIFIER, TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG) \
|
MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
|
||||||
\
|
\
|
||||||
template< \
|
template< \
|
||||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||||
@ -90,19 +97,46 @@
|
|||||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
|
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
|
||||||
\
|
\
|
||||||
template<typename Seq> \
|
template<typename Seq> \
|
||||||
static typename add_reference<type>::type \
|
struct apply \
|
||||||
call(Seq& seq) \
|
|
||||||
{ \
|
{ \
|
||||||
return seq.PREFIX \
|
typedef typename \
|
||||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \
|
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) \
|
||||||
|
> \
|
||||||
|
>::type \
|
||||||
|
>::type \
|
||||||
|
type; \
|
||||||
\
|
\
|
||||||
template<typename Seq> \
|
static type \
|
||||||
static typename add_reference<typename add_const<type>::type>::type \
|
call(Seq& seq) \
|
||||||
call(Seq const& seq) \
|
{ \
|
||||||
|
return seq.PREFIX \
|
||||||
|
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \
|
||||||
|
} \
|
||||||
|
}; \
|
||||||
|
}; \
|
||||||
|
\
|
||||||
|
template< \
|
||||||
|
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||||
|
> \
|
||||||
|
struct struct_member_name< \
|
||||||
|
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||||
|
, I \
|
||||||
|
> \
|
||||||
|
{ \
|
||||||
|
typedef char const* type; \
|
||||||
|
\
|
||||||
|
static type \
|
||||||
|
call() \
|
||||||
{ \
|
{ \
|
||||||
return seq.PREFIX \
|
return BOOST_PP_STRINGIZE( \
|
||||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \
|
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)); \
|
||||||
} \
|
} \
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -116,9 +150,9 @@ namespace boost
|
|||||||
namespace traits \
|
namespace traits \
|
||||||
{ \
|
{ \
|
||||||
BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
|
BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
|
||||||
BOOST_PP_EMPTY(),TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG) \
|
BOOST_PP_EMPTY(), TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
|
||||||
BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
|
BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
|
||||||
const,TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG) \
|
const, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
namespace extension \
|
namespace extension \
|
||||||
|
@ -7,13 +7,10 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_AT_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_AT_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_AT_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_AT_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/fusion/support/detail/access.hpp>
|
#include <boost/mpl/int.hpp>
|
||||||
#include <boost/mpl/eval_if.hpp>
|
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
#include <boost/type_traits/is_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
namespace boost { namespace fusion { namespace extension
|
||||||
{
|
{
|
||||||
@ -25,28 +22,11 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
{
|
{
|
||||||
template <typename Seq, typename N>
|
template <typename Seq, typename N>
|
||||||
struct apply
|
struct apply
|
||||||
{
|
: extension::struct_member<
|
||||||
typedef
|
typename remove_const<Seq>::type
|
||||||
extension::struct_member<
|
, N::value
|
||||||
typename remove_const<Seq>::type
|
>::template apply<Seq>
|
||||||
, N::value
|
{};
|
||||||
>
|
|
||||||
member;
|
|
||||||
|
|
||||||
typedef typename
|
|
||||||
mpl::eval_if<
|
|
||||||
is_const<Seq>
|
|
||||||
, detail::cref_result<member>
|
|
||||||
, detail::ref_result<member>
|
|
||||||
>::type
|
|
||||||
type;
|
|
||||||
|
|
||||||
static type
|
|
||||||
call(Seq& seq)
|
|
||||||
{
|
|
||||||
return member::call(seq);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_BEGIN_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_BEGIN_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_BEGIN_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_BEGIN_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/fusion/iterator/basic_iterator.hpp>
|
#include <boost/fusion/iterator/basic_iterator.hpp>
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
{
|
{
|
||||||
typedef
|
typedef
|
||||||
basic_iterator<
|
basic_iterator<
|
||||||
assoc_struct_iterator_tag
|
struct_iterator_tag
|
||||||
, assoc_struct_category
|
, assoc_struct_category
|
||||||
, Seq
|
, Seq
|
||||||
, 0
|
, 0
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_CATEGORY_OF_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_CATEGORY_OF_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_CATEGORY_OF_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_CATEGORY_OF_IMPL_HPP
|
||||||
|
|
||||||
namespace boost { namespace fusion
|
namespace boost { namespace fusion
|
||||||
{
|
{
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_DATA_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_DATA_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_DATA_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_DATA_IMPL_HPP
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
namespace boost { namespace fusion { namespace extension
|
||||||
{
|
{
|
||||||
@ -14,8 +14,8 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
struct deref_data_impl;
|
struct deref_data_impl;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct deref_data_impl<assoc_struct_iterator_tag>
|
struct deref_data_impl<struct_iterator_tag>
|
||||||
: deref_impl<assoc_struct_iterator_tag>
|
: deref_impl<struct_iterator_tag>
|
||||||
{};
|
{};
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
@ -5,13 +5,8 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEREF_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/fusion/support/detail/access.hpp>
|
|
||||||
#include <boost/mpl/eval_if.hpp>
|
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
#include <boost/type_traits/is_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
namespace boost { namespace fusion { namespace extension
|
||||||
{
|
{
|
||||||
@ -24,33 +19,23 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
template <typename It>
|
template <typename It>
|
||||||
struct apply
|
struct apply
|
||||||
{
|
{
|
||||||
typedef
|
typedef typename
|
||||||
extension::struct_member<
|
extension::struct_member<
|
||||||
typename remove_const<typename It::seq_type>::type
|
typename remove_const<typename It::seq_type>::type
|
||||||
, It::index::value
|
, It::index::value
|
||||||
>
|
>::template apply<typename It::seq_type>
|
||||||
member;
|
impl;
|
||||||
|
|
||||||
typedef typename
|
typedef typename impl::type type;
|
||||||
mpl::eval_if<
|
|
||||||
is_const<typename It::seq_type>
|
|
||||||
, detail::cref_result<member>
|
|
||||||
, detail::ref_result<member>
|
|
||||||
>::type
|
|
||||||
type;
|
|
||||||
|
|
||||||
static type
|
static
|
||||||
call(It const& it)
|
type
|
||||||
{
|
call(It const& it)
|
||||||
return member::call(*it.seq);
|
{
|
||||||
}
|
return impl::call(*it.seq);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
|
||||||
struct deref_impl<assoc_struct_iterator_tag>
|
|
||||||
: deref_impl<struct_iterator_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -7,11 +7,10 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_END_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_END_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/fusion/iterator/basic_iterator.hpp>
|
#include <boost/fusion/iterator/basic_iterator.hpp>
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
namespace boost { namespace fusion { namespace extension
|
||||||
{
|
{
|
||||||
@ -49,7 +48,7 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
{
|
{
|
||||||
typedef
|
typedef
|
||||||
basic_iterator<
|
basic_iterator<
|
||||||
assoc_struct_iterator_tag
|
struct_iterator_tag
|
||||||
, assoc_struct_category
|
, assoc_struct_category
|
||||||
, Seq
|
, Seq
|
||||||
, struct_size<typename remove_const<Seq>::type>::value
|
, struct_size<typename remove_const<Seq>::type>::value
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_EXTENSION_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_EXTENSION_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_EXTENSION_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_EXTENSION_HPP
|
||||||
|
|
||||||
#include <boost/fusion/support/category_of.hpp>
|
#include <boost/fusion/support/category_of.hpp>
|
||||||
|
|
||||||
@ -17,7 +17,6 @@ namespace boost { namespace fusion
|
|||||||
struct struct_tag;
|
struct struct_tag;
|
||||||
struct struct_iterator_tag;
|
struct struct_iterator_tag;
|
||||||
struct assoc_struct_tag;
|
struct assoc_struct_tag;
|
||||||
struct assoc_struct_iterator_tag;
|
|
||||||
struct fusion_sequence_tag;
|
struct fusion_sequence_tag;
|
||||||
|
|
||||||
struct assoc_struct_category
|
struct assoc_struct_category
|
||||||
@ -31,6 +30,9 @@ namespace boost { namespace fusion
|
|||||||
template<typename Seq, int N>
|
template<typename Seq, int N>
|
||||||
struct struct_member;
|
struct struct_member;
|
||||||
|
|
||||||
|
template<typename Seq, int N>
|
||||||
|
struct struct_member_name;
|
||||||
|
|
||||||
template<typename Seq, int N>
|
template<typename Seq, int N>
|
||||||
struct struct_assoc_key;
|
struct struct_assoc_key;
|
||||||
|
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
Copyright (c) 2001-2006 Joel de Guzman
|
Copyright (c) 2001-2006 Joel de Guzman
|
||||||
Copyright (c) 2005-2006 Dan Marsden
|
Copyright (c) 2005-2006 Dan Marsden
|
||||||
|
Copyright (c) 2009-2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_IS_SEQUENCE_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_SEQUENCE_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_IS_SEQUENCE_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_SEQUENCE_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/mpl/bool.hpp>
|
#include <boost/mpl/bool.hpp>
|
||||||
|
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
Copyright (c) 2001-2006 Joel de Guzman
|
Copyright (c) 2001-2006 Joel de Guzman
|
||||||
Copyright (c) 2005-2006 Dan Marsden
|
Copyright (c) 2005-2006 Dan Marsden
|
||||||
|
Copyright (c) 2009-2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_IS_VIEW_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_IS_VIEW_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/mpl/bool.hpp>
|
#include <boost/mpl/bool.hpp>
|
||||||
|
|
||||||
|
@ -5,10 +5,8 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_KEY_OF_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_KEY_OF_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_KEY_OF_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_KEY_OF_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
namespace boost { namespace fusion { namespace extension
|
||||||
{
|
{
|
||||||
@ -16,18 +14,15 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
struct key_of_impl;
|
struct key_of_impl;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct key_of_impl<assoc_struct_iterator_tag>
|
struct key_of_impl<struct_iterator_tag>
|
||||||
{
|
{
|
||||||
template <typename It>
|
template <typename It>
|
||||||
struct apply
|
struct apply
|
||||||
{
|
: extension::struct_assoc_key<
|
||||||
typedef typename
|
typename remove_const<typename It::seq_type>::type
|
||||||
extension::struct_assoc_key<
|
, It::index::value
|
||||||
typename remove_const<typename It::seq_type>::type
|
>
|
||||||
, It::index::value
|
{};
|
||||||
>::type
|
|
||||||
type;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
|
Copyright (c) 2009-2010 Hartmut Kaiser
|
||||||
Copyright (c) 2010 Christopher Schmidt
|
Copyright (c) 2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_PROXY_TYPE_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PROXY_TYPE_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_PROXY_TYPE_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PROXY_TYPE_HPP
|
||||||
|
|
||||||
#include <boost/preprocessor/dec.hpp>
|
#include <boost/preprocessor/dec.hpp>
|
||||||
#include <boost/preprocessor/control/if.hpp>
|
#include <boost/preprocessor/control/if.hpp>
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
Copyright (c) 2001-2006 Joel de Guzman
|
Copyright (c) 2001-2006 Joel de Guzman
|
||||||
Copyright (c) 2005-2006 Dan Marsden
|
Copyright (c) 2005-2006 Dan Marsden
|
||||||
|
Copyright (c) 2009-2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_SIZE_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_SIZE_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_SIZE_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_SIZE_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
namespace boost { namespace fusion { namespace extension
|
||||||
{
|
{
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
Copyright (c) 2001-2006 Joel de Guzman
|
Copyright (c) 2001-2006 Joel de Guzman
|
||||||
Copyright (c) 2005-2006 Dan Marsden
|
Copyright (c) 2005-2006 Dan Marsden
|
||||||
|
Copyright (c) 2009-2010 Christopher Schmidt
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_AT_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_AT_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_AT_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_AT_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
namespace boost { namespace fusion { namespace extension
|
||||||
{
|
{
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_OF_DATA_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_OF_DATA_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_DATA_IMPL_HPP
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
namespace boost { namespace fusion { namespace extension
|
||||||
{
|
{
|
||||||
@ -14,8 +14,8 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
struct value_of_data_impl;
|
struct value_of_data_impl;
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct value_of_data_impl<assoc_struct_iterator_tag>
|
struct value_of_data_impl<struct_iterator_tag>
|
||||||
: value_of_impl<assoc_struct_iterator_tag>
|
: value_of_impl<struct_iterator_tag>
|
||||||
{};
|
{};
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
|
@ -5,10 +5,8 @@
|
|||||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_OF_IMPL_HPP
|
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_IMPL_HPP
|
||||||
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_VALUE_OF_IMPL_HPP
|
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_IMPL_HPP
|
||||||
|
|
||||||
#include <boost/type_traits/remove_const.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion { namespace extension
|
namespace boost { namespace fusion { namespace extension
|
||||||
{
|
{
|
||||||
@ -20,20 +18,12 @@ namespace boost { namespace fusion { namespace extension
|
|||||||
{
|
{
|
||||||
template <typename It>
|
template <typename It>
|
||||||
struct apply
|
struct apply
|
||||||
{
|
: extension::struct_member<
|
||||||
typedef typename
|
typename remove_const<typename It::seq_type>::type
|
||||||
extension::struct_member<
|
, It::index::value
|
||||||
typename remove_const<typename It::seq_type>::type
|
>
|
||||||
, It::index::value
|
{};
|
||||||
>::type
|
|
||||||
type;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
|
||||||
struct value_of_impl<assoc_struct_iterator_tag>
|
|
||||||
: value_of_impl<struct_iterator_tag>
|
|
||||||
{};
|
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,9 +32,8 @@ namespace boost { namespace fusion { namespace detail
|
|||||||
static bool
|
static bool
|
||||||
call(I1 const& a, I2 const& b, mpl::false_)
|
call(I1 const& a, I2 const& b, mpl::false_)
|
||||||
{
|
{
|
||||||
return *a > *b
|
return *a > *b ||
|
||||||
|| !(*b > *a)
|
(!(*b > *a) && call(fusion::next(a), fusion::next(b)));
|
||||||
&& call(fusion::next(a), fusion::next(b));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename I1, typename I2>
|
template <typename I1, typename I2>
|
||||||
|
@ -32,9 +32,8 @@ namespace boost { namespace fusion { namespace detail
|
|||||||
static bool
|
static bool
|
||||||
call(I1 const& a, I2 const& b, mpl::false_)
|
call(I1 const& a, I2 const& b, mpl::false_)
|
||||||
{
|
{
|
||||||
return *a < *b
|
return *a < *b ||
|
||||||
|| !(*b < *a)
|
(!(*b < *a) && call(fusion::next(a), fusion::next(b)));
|
||||||
&& call(fusion::next(a), fusion::next(b));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename I1, typename I2>
|
template <typename I1, typename I2>
|
||||||
|
Reference in New Issue
Block a user