Added boost header

This commit is contained in:
Christophe Riccio
2012-01-08 01:26:07 +00:00
parent 9c3faaca40
commit c7d752cdf8
8946 changed files with 1732316 additions and 0 deletions

25
test/external/boost/fusion/adapted.hpp vendored Normal file
View File

@@ -0,0 +1,25 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_ADAPTED_30122005_1420)
#define BOOST_FUSION_ADAPTED_30122005_1420
#include <boost/fusion/adapted/adt.hpp>
#include <boost/fusion/adapted/array.hpp>
#include <boost/fusion/adapted/boost_array.hpp>
#include <boost/fusion/adapted/boost_tuple.hpp>
#include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/adapted/std_pair.hpp>
#include <boost/fusion/adapted/struct.hpp>
// The std_tuple_iterator adaptor only supports implementations
// using variadic templates
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
#include <boost/fusion/adapted/std_tuple.hpp>
#endif
#endif

View File

@@ -0,0 +1,18 @@
/*=============================================================================
Copyright (c) 2001-2011 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_HPP
#define BOOST_FUSION_ADAPTED_ADT_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

View File

@@ -0,0 +1,73 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2009-2010 Hartmut Kaiser
Copyright (c) 2010-2011 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_ADAPT_ADT_HPP
#define BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_HPP
#include <boost/preprocessor/cat.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/adt/detail/extension.hpp>
#include <boost/fusion/adapted/adt/detail/adapt_base.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_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_ADT_FILLER_0(0,0,0,0)ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ADT_C)
#define BOOST_FUSION_ADAPT_ADT(NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(0), \
(0)(NAME), \
struct_tag, \
0, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ADT_FILLER_0(0,0,0,0)ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ADT_C)
#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_ADT_FILLER_0(0,0,0,0)ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ADT_C)
#endif

View File

@@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2009-2010 Hartmut Kaiser
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_ADAPT_ADT_NAMED_HPP
#define BOOST_FUSION_ADAPTED_ADT_ADAPT_ADT_NAMED_HPP
#include <boost/fusion/adapted/adt/adapt_adt.hpp>
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
#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_ADT_AS_VIEW( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
ATTRIBUTES)
#define BOOST_FUSION_ADAPT_ADT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_ADT_NAMED_NS( \
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
#endif

View File

@@ -0,0 +1,90 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2007 Dan Marsden
Copyright (c) 2010-2011 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_ADAPT_ASSOC_ADT_HPP
#define BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_HPP
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/empty.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/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
#define BOOST_FUSION_ADAPT_ASSOC_ADT_C( \
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
\
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) \
> \
struct struct_assoc_key<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
{ \
typedef BOOST_PP_TUPLE_ELEM(5, 4, ATTRIBUTE) type; \
};
#define BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( \
TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \
\
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(1)TEMPLATE_PARAMS_SEQ, \
(1)NAME_SEQ, \
assoc_struct_tag, \
0, \
BOOST_PP_CAT( \
BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(0,0,0,0,0)ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_ADT_C)
#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_ADT_FILLER_0(0,0,0,0,0)ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_ADT_C)
#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_ADT_FILLER_0(0,0,0,0,0)ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_ADT_C)
#endif

View File

@@ -0,0 +1,28 @@
/*=============================================================================
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_ADAPT_ASSOC_ADT_NAMED_HPP
#define BOOST_FUSION_ADAPTED_ADT_ADAPT_ASSOC_ADT_NAMED_HPP
#include <boost/fusion/adapted/adt/adapt_assoc_adt.hpp>
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
#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_ADT_AS_VIEW( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
ATTRIBUTES)
#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

View 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) \
\
boost::remove_const<boost::remove_reference<lvalue>::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 Val> \
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); \
} \
\
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& 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)& o) \
: obj(&o) \
{} \
\
template<class Val> \
adt_attribute_proxy& \
operator=(Val 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

View File

@@ -0,0 +1,24 @@
/*=============================================================================
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_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 detail
{
template <typename T, typename Dummy>
struct get_identity
: remove_const<typename remove_reference<T>::type>
{};
}}}
#endif

View File

@@ -0,0 +1,27 @@
/*=============================================================================
Copyright (c) 2001-2011 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)
==============================================================================*/
#if !defined(BOOST_FUSION_ARRAY_27122005_1035)
#define BOOST_FUSION_ARRAY_27122005_1035
//For backwards compatibility
#include <boost/fusion/adapted/boost_array.hpp>
#include <boost/fusion/adapted/array/tag_of.hpp>
#include <boost/fusion/adapted/array/is_view_impl.hpp>
#include <boost/fusion/adapted/array/is_sequence_impl.hpp>
#include <boost/fusion/adapted/array/category_of_impl.hpp>
#include <boost/fusion/adapted/array/begin_impl.hpp>
#include <boost/fusion/adapted/array/end_impl.hpp>
#include <boost/fusion/adapted/array/size_impl.hpp>
#include <boost/fusion/adapted/array/at_impl.hpp>
#include <boost/fusion/adapted/array/value_at_impl.hpp>
#include <boost/fusion/adapted/array/deref_impl.hpp>
#include <boost/fusion/adapted/array/value_of_impl.hpp>
#endif

View File

@@ -0,0 +1,38 @@
/*=============================================================================
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_ARRAY_AT_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_AT_IMPL_HPP
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/remove_extent.hpp>
namespace boost { namespace fusion { namespace extension
{
template<typename>
struct at_impl;
template<>
struct at_impl<po_array_tag>
{
template<typename Seq, typename N>
struct apply
{
typedef typename
add_reference<typename remove_extent<Seq>::type>::type
type;
static type
call(Seq& seq)
{
return seq[N::value];
}
};
};
}}}
#endif

View File

@@ -0,0 +1,42 @@
/*=============================================================================
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_ARRAY_BEGIN_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_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<po_array_tag>
{
template <typename Seq>
struct apply
{
typedef
basic_iterator<
po_array_iterator_tag
, random_access_traversal_tag
, Seq
, 0
>
type;
static type
call(Seq& seq)
{
return type(seq,0);
}
};
};
}}}
#endif

View File

@@ -0,0 +1,32 @@
/*=============================================================================
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_ARRAY_CATEGORY_OF_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_CATEGORY_OF_IMPL_HPP
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
namespace extension
{
template<typename>
struct category_of_impl;
template<>
struct category_of_impl<po_array_tag>
{
template<typename Seq>
struct apply
{
typedef random_access_traversal_tag type;
};
};
}
}}
#endif

View File

@@ -0,0 +1,40 @@
/*=============================================================================
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_ARRAY_DEREF_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_DEREF_IMPL_HPP
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/remove_extent.hpp>
namespace boost { namespace fusion { namespace extension
{
template <typename>
struct deref_impl;
template <>
struct deref_impl<po_array_iterator_tag>
{
template <typename It>
struct apply
{
typedef typename
add_reference<
typename remove_extent<typename It::seq_type>::type
>::type
type;
static type
call(It const& it)
{
return (*it.seq)[It::index::value];
}
};
};
}}}
#endif

View File

@@ -0,0 +1,44 @@
/*=============================================================================
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_ARRAY_END_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_END_IMPL_HPP
#include <boost/fusion/iterator/basic_iterator.hpp>
#include <boost/type_traits/rank.hpp>
#include <boost/type_traits/extent.hpp>
namespace boost { namespace fusion { namespace extension
{
template <typename>
struct end_impl;
template <>
struct end_impl<po_array_tag>
{
template <typename Seq>
struct apply
{
typedef
basic_iterator<
po_array_iterator_tag
, random_access_traversal_tag
, Seq
, extent<Seq,rank<Seq>::value-1>::value
>
type;
static type
call(Seq& seq)
{
return type(seq,0);
}
};
};
}}}
#endif

View File

@@ -0,0 +1,28 @@
/*=============================================================================
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_ARRAY_IS_SEQUENCE_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_IS_SEQUENCE_IMPL_HPP
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion { namespace extension
{
template<typename>
struct is_sequence_impl;
template<>
struct is_sequence_impl<po_array_tag>
{
template<typename Seq>
struct apply
: mpl::true_
{};
};
}}}
#endif

View File

@@ -0,0 +1,28 @@
/*=============================================================================
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_ARRAY_IS_VIEW_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_IS_VIEW_IMPL_HPP
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion { namespace extension
{
template<typename>
struct is_view_impl;
template<>
struct is_view_impl<po_array_tag>
{
template<typename Seq>
struct apply
: mpl::false_
{};
};
}}}
#endif

View File

@@ -0,0 +1,29 @@
/*=============================================================================
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_ARRAY_SIZE_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_SIZE_IMPL_HPP
#include <boost/type_traits/rank.hpp>
#include <boost/type_traits/extent.hpp>
namespace boost { namespace fusion { namespace extension
{
template<typename>
struct size_impl;
template<>
struct size_impl<po_array_tag>
{
template<typename Seq>
struct apply
: extent<Seq,rank<Seq>::value-1>
{};
};
}}}
#endif

View File

@@ -0,0 +1,72 @@
/*=============================================================================
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_ARRAY_TAG_OF_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_TAG_OF_HPP
#include <boost/fusion/support/tag_of_fwd.hpp>
#include <cstddef>
namespace boost
{
namespace fusion
{
struct po_array_tag;
struct po_array_iterator_tag;
struct random_access_traversal_tag;
struct fusion_sequence_tag;
namespace traits
{
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
template<typename T, std::size_t N>
struct tag_of<T[N], void>
{
typedef po_array_tag type;
};
template<typename T, std::size_t N>
struct tag_of<T const[N], void>
{
typedef po_array_tag type;
};
#else
template<typename T, std::size_t N>
struct tag_of<T[N], void>
{
typedef po_array_tag type;
};
template<typename T, std::size_t N>
struct tag_of<T const[N], void>
{
typedef po_array_tag type;
};
#endif
}
}
namespace mpl
{
template<typename>
struct sequence_tag;
template<typename T, std::size_t N>
struct sequence_tag<T[N]>
{
typedef fusion::po_array_tag type;
};
template<typename T, std::size_t N>
struct sequence_tag<T const[N] >
{
typedef fusion::po_array_tag type;
};
}
}
#endif

View File

@@ -0,0 +1,28 @@
/*=============================================================================
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_ARRAY_VALUE_AT_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_VALUE_AT_IMPL_HPP
#include <boost/type_traits/remove_extent.hpp>
namespace boost { namespace fusion { namespace extension
{
template<typename>
struct value_at_impl;
template <>
struct value_at_impl<po_array_tag>
{
template <typename Seq, typename N>
struct apply
: remove_extent<Seq>
{};
};
}}}
#endif

View File

@@ -0,0 +1,28 @@
/*=============================================================================
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_ARRAY_VALUE_OF_IMPL_HPP
#define BOOST_FUSION_ADAPTED_ARRAY_VALUE_OF_IMPL_HPP
#include <boost/type_traits/remove_extent.hpp>
namespace boost { namespace fusion { namespace extension
{
template <typename>
struct value_of_impl;
template <>
struct value_of_impl<po_array_iterator_tag>
{
template <typename It>
struct apply
: remove_extent<typename It::seq_type>
{};
};
}}}
#endif

View File

@@ -0,0 +1,22 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_BOOST_ARRAY_27122005_1035)
#define BOOST_FUSION_BOOST_ARRAY_27122005_1035
#include <boost/fusion/adapted/boost_array/array_iterator.hpp>
#include <boost/fusion/adapted/boost_array/tag_of.hpp>
#include <boost/fusion/adapted/boost_array/detail/is_view_impl.hpp>
#include <boost/fusion/adapted/boost_array/detail/is_sequence_impl.hpp>
#include <boost/fusion/adapted/boost_array/detail/category_of_impl.hpp>
#include <boost/fusion/adapted/boost_array/detail/begin_impl.hpp>
#include <boost/fusion/adapted/boost_array/detail/end_impl.hpp>
#include <boost/fusion/adapted/boost_array/detail/size_impl.hpp>
#include <boost/fusion/adapted/boost_array/detail/at_impl.hpp>
#include <boost/fusion/adapted/boost_array/detail/value_at_impl.hpp>
#endif

View File

@@ -0,0 +1,107 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_ARRAY_ITERATOR_26122005_2250)
#define BOOST_FUSION_ARRAY_ITERATOR_26122005_2250
#include <cstddef>
#include <boost/config.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/minus.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp>
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
template <typename Array, int Pos>
struct array_iterator
: iterator_facade<array_iterator<Array, Pos>, random_access_traversal_tag>
{
BOOST_MPL_ASSERT_RELATION(Pos, >=, 0);
BOOST_MPL_ASSERT_RELATION(Pos, <=, static_cast<int>(Array::static_size));
typedef mpl::int_<Pos> index;
typedef Array array_type;
array_iterator(Array& a)
: array(a) {}
Array& array;
template <typename Iterator>
struct value_of
{
typedef typename Iterator::array_type array_type;
typedef typename array_type::value_type type;
};
template <typename Iterator>
struct deref
{
typedef typename Iterator::array_type array_type;
typedef typename
mpl::if_<
is_const<array_type>
, typename array_type::const_reference
, typename array_type::reference
>::type
type;
static type
call(Iterator const & it)
{
return it.array[Iterator::index::value];
}
};
template <typename Iterator, typename N>
struct advance
{
typedef typename Iterator::index index;
typedef typename Iterator::array_type array_type;
typedef array_iterator<array_type, index::value + N::value> type;
static type
call(Iterator const& i)
{
return type(i.array);
}
};
template <typename Iterator>
struct next : advance<Iterator, mpl::int_<1> > {};
template <typename Iterator>
struct prior : advance<Iterator, mpl::int_<-1> > {};
template <typename I1, typename I2>
struct distance : mpl::minus<typename I2::index, typename I1::index>
{
typedef typename
mpl::minus<
typename I2::index, typename I1::index
>::type
type;
static type
call(I1 const&, I2 const&)
{
return type();
}
};
private:
array_iterator<Array, Pos>& operator=(array_iterator<Array, Pos> const&);
};
}}
#endif

View File

@@ -0,0 +1,45 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_AT_IMPL_27122005_1241)
#define BOOST_FUSION_AT_IMPL_27122005_1241
#include <boost/type_traits/is_const.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace fusion {
struct boost_array_tag;
namespace extension
{
template<typename T>
struct at_impl;
template<>
struct at_impl<boost_array_tag>
{
template<typename Sequence, typename N>
struct apply
{
typedef typename mpl::if_<
is_const<Sequence>,
typename Sequence::const_reference,
typename Sequence::reference>::type type;
static type
call(Sequence& seq)
{
return seq[N::value];
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,40 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_BEGIN_IMPL_27122005_1117)
#define BOOST_FUSION_BEGIN_IMPL_27122005_1117
#include <boost/fusion/adapted/boost_array/array_iterator.hpp>
namespace boost { namespace fusion {
struct boost_array_tag;
namespace extension
{
template<typename T>
struct begin_impl;
template <>
struct begin_impl<boost_array_tag>
{
template <typename Sequence>
struct apply
{
typedef array_iterator<Sequence, 0> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,35 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_CATEGORY_OF_IMPL_27122005_1044)
#define BOOST_FUSION_CATEGORY_OF_IMPL_27122005_1044
#include <boost/config/no_tr1/utility.hpp>
namespace boost { namespace fusion {
struct boost_array_tag;
struct random_access_traversal_tag;
namespace extension
{
template<typename T>
struct category_of_impl;
template<>
struct category_of_impl<boost_array_tag>
{
template<typename T>
struct apply
{
typedef random_access_traversal_tag type;
};
};
}
}}
#endif

View File

@@ -0,0 +1,40 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_END_IMPL_27122005_1120)
#define BOOST_FUSION_END_IMPL_27122005_1120
#include <boost/fusion/adapted/boost_array/array_iterator.hpp>
namespace boost { namespace fusion {
struct boost_array_tag;
namespace extension
{
template <typename Tag>
struct end_impl;
template <>
struct end_impl<boost_array_tag>
{
template <typename Sequence>
struct apply
{
typedef array_iterator<Sequence, Sequence::static_size> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_IS_SEQUENCE_IMPL_27122005_1648)
#define BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1648
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion {
struct boost_array_tag;
namespace extension
{
template<typename Tag>
struct is_sequence_impl;
template<>
struct is_sequence_impl<boost_array_tag>
{
template<typename Sequence>
struct apply : mpl::true_ {};
};
}
}}
#endif

View File

@@ -0,0 +1,32 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_IS_VIEW_IMPL_27042006_2221)
#define BOOST_FUSION_IS_VIEW_IMPL_27042006_2221
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct boost_array_tag;
namespace extension
{
template<typename Tag>
struct is_view_impl;
template<>
struct is_view_impl<boost_array_tag>
{
template<typename T>
struct apply : mpl::false_
{};
};
}
}}
#endif

View File

@@ -0,0 +1,29 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_SIZE_IMPL_27122005_1251)
#define BOOST_FUSION_SIZE_IMPL_27122005_1251
namespace boost { namespace fusion {
struct boost_array_tag;
namespace extension
{
template<typename T>
struct size_impl;
template<>
struct size_impl<boost_array_tag>
{
template<typename Sequence>
struct apply : mpl::int_<Sequence::static_size> {};
};
}
}}
#endif

View File

@@ -0,0 +1,32 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_VALUE_AT_IMPL_27122005_1256)
#define BOOST_FUSION_VALUE_AT_IMPL_27122005_1256
namespace boost { namespace fusion {
struct boost_array_tag;
namespace extension
{
template<typename T>
struct value_at_impl;
template <>
struct value_at_impl<boost_array_tag>
{
template <typename Sequence, typename N>
struct apply
{
typedef typename Sequence::value_type type;
};
};
}
}}
#endif

View File

@@ -0,0 +1,58 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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(FUSION_SEQUENCE_TAG_OF_27122005_1030)
#define FUSION_SEQUENCE_TAG_OF_27122005_1030
#include <boost/fusion/support/tag_of_fwd.hpp>
#include <cstddef>
namespace boost
{
template<typename T, std::size_t N>
class array;
}
namespace boost { namespace fusion
{
struct boost_array_tag;
struct fusion_sequence_tag;
namespace traits
{
template<typename T, std::size_t N>
#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
struct tag_of<boost::array<T,N>, void >
#else
struct tag_of<boost::array<T,N> >
#endif
{
typedef boost_array_tag type;
};
}
}}
namespace boost { namespace mpl
{
template<typename>
struct sequence_tag;
template<typename T, std::size_t N>
struct sequence_tag<array<T,N> >
{
typedef fusion::fusion_sequence_tag type;
};
template<typename T, std::size_t N>
struct sequence_tag<array<T,N> const>
{
typedef fusion::fusion_sequence_tag type;
};
}}
#endif

View File

@@ -0,0 +1,20 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_BOOST_TUPLE_09272006_0732)
#define BOOST_FUSION_BOOST_TUPLE_09272006_0732
#include <boost/fusion/adapted/boost_tuple/tag_of.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp>
#include <boost/fusion/adapted/boost_tuple/detail/end_impl.hpp>
#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>
#endif

View File

@@ -0,0 +1,189 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_BOOST_TUPLE_ITERATOR_09262006_1851)
#define FUSION_BOOST_TUPLE_ITERATOR_09262006_1851
#include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/tuple/tuple.hpp>
namespace boost { namespace fusion
{
struct forward_traversal_tag;
namespace detail
{
template <typename T>
struct boost_tuple_is_empty : mpl::false_ {};
template <>
struct boost_tuple_is_empty<tuples::null_type> : mpl::true_ {};
template <>
struct boost_tuple_is_empty<tuples::null_type const> : mpl::true_ {};
template <>
struct boost_tuple_is_empty<tuples::tuple<> > : mpl::true_ {};
template <>
struct boost_tuple_is_empty<tuples::tuple<> const> : mpl::true_ {};
}
template <typename Cons = tuples::null_type>
struct boost_tuple_iterator
: iterator_facade<boost_tuple_iterator<Cons>, forward_traversal_tag>
{
typedef Cons cons_type;
explicit boost_tuple_iterator(Cons& in_cons)
: cons(in_cons) {}
Cons& cons;
template <typename Iterator>
struct value_of : mpl::identity<typename Iterator::cons_type::head_type> {};
template <typename Iterator>
struct deref
{
typedef typename value_of<Iterator>::type element;
typedef typename
mpl::if_<
is_const<typename Iterator::cons_type>
, typename tuples::access_traits<element>::const_type
, typename tuples::access_traits<element>::non_const_type
>::type
type;
static type
call(Iterator const& iter)
{
return iter.cons.get_head();
}
};
template <typename Iterator>
struct next
{
typedef typename Iterator::cons_type cons_type;
typedef typename cons_type::tail_type tail_type;
typedef boost_tuple_iterator<
typename mpl::eval_if<
is_const<cons_type>
, add_const<tail_type>
, mpl::identity<tail_type>
>::type>
type;
static type
call(Iterator const& iter)
{
return type(iter.cons.get_tail());
}
};
template <typename I1, typename I2>
struct distance;
// detail
template <typename I1, typename I2>
struct lazy_next_distance
{
typedef
typename mpl::plus<
mpl::int_<1>,
typename distance<
typename next<I1>::type,
I2
>::type
>::type type;
};
template <typename I1, typename I2>
struct distance
{
typedef typename mpl::eval_if<
boost::is_same<I1, I2>,
mpl::int_<0>,
lazy_next_distance<I1, I2>
>::type type;
static type
call(I1 const&, I2 const&)
{
return type();
}
};
private:
// silence MSVC warning C4512: assignment operator could not be generated
boost_tuple_iterator& operator= (boost_tuple_iterator const&);
};
template <typename Null>
struct boost_tuple_null_iterator
: iterator_facade<boost_tuple_iterator<Null>, forward_traversal_tag>
{
typedef Null cons_type;
template <typename I1, typename I2>
struct equal_to
: mpl::or_<
is_same<I1, I2>
, mpl::and_<
detail::boost_tuple_is_empty<typename I1::cons_type>
, detail::boost_tuple_is_empty<typename I2::cons_type>
>
>
{};
};
template <>
struct boost_tuple_iterator<tuples::null_type>
: boost_tuple_null_iterator<tuples::null_type>
{
template <typename Cons>
explicit boost_tuple_iterator(Cons const&) {}
};
template <>
struct boost_tuple_iterator<tuples::null_type const>
: boost_tuple_null_iterator<tuples::null_type const>
{
template <typename Cons>
explicit boost_tuple_iterator(Cons const&) {}
};
template <>
struct boost_tuple_iterator<tuples::tuple<> >
: boost_tuple_null_iterator<tuples::tuple<> >
{
template <typename Cons>
explicit boost_tuple_iterator(Cons const&) {}
};
template <>
struct boost_tuple_iterator<tuples::tuple<> const>
: boost_tuple_null_iterator<tuples::tuple<> const>
{
template <typename Cons>
explicit boost_tuple_iterator(Cons const&) {}
};
}}
#endif

View File

@@ -0,0 +1,50 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_AT_IMPL_09262006_1920)
#define BOOST_FUSION_AT_IMPL_09262006_1920
#include <boost/tuple/tuple.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace fusion
{
struct boost_tuple_tag;
namespace extension
{
template<typename T>
struct at_impl;
template <>
struct at_impl<boost_tuple_tag>
{
template <typename Sequence, typename N>
struct apply
{
typedef typename
tuples::element<N::value, Sequence>::type
element;
typedef typename
mpl::if_<
is_const<Sequence>
, typename tuples::access_traits<element>::const_type
, typename tuples::access_traits<element>::non_const_type
>::type
type;
static type
call(Sequence& seq)
{
return tuples::get<N::value>(seq);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,39 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_BEGIN_IMPL_09272006_0719)
#define BOOST_FUSION_BEGIN_IMPL_09272006_0719
#include <boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp>
namespace boost { namespace fusion
{
struct boost_tuple_tag;
namespace extension
{
template<typename T>
struct begin_impl;
template <>
struct begin_impl<boost_tuple_tag>
{
template <typename Sequence>
struct apply
{
typedef boost_tuple_iterator<Sequence> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,32 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_CATEGORY_OF_IMPL_09272006_0726)
#define BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726
namespace boost { namespace fusion
{
struct boost_tuple_tag;
struct forward_traversal_tag;
namespace extension
{
template<typename T>
struct category_of_impl;
template<>
struct category_of_impl<boost_tuple_tag>
{
template<typename T>
struct apply
{
typedef forward_traversal_tag type;
};
};
}
}}
#endif

View File

@@ -0,0 +1,54 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_END_IMPL_09272006_0721)
#define BOOST_FUSION_END_IMPL_09272006_0721
#include <boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.hpp>
namespace boost { namespace tuples
{
struct null_type;
}}
namespace boost { namespace fusion
{
struct boost_tuple_tag;
namespace extension
{
template <typename Tag>
struct end_impl;
template <>
struct end_impl<boost_tuple_tag>
{
template <typename Sequence>
struct apply
{
typedef
boost_tuple_iterator<
typename mpl::if_<
is_const<Sequence>
, tuples::null_type const
, tuples::null_type
>::type
>
type;
static type
call(Sequence& seq)
{
return type(seq);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_IS_SEQUENCE_IMPL_09272006_0726)
#define BOOST_FUSION_IS_SEQUENCE_IMPL_09272006_0726
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct boost_tuple_tag;
namespace extension
{
template<typename Tag>
struct is_sequence_impl;
template<>
struct is_sequence_impl<boost_tuple_tag>
{
template<typename Sequence>
struct apply : mpl::true_ {};
};
}
}}
#endif

View File

@@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_IS_VIEW_IMPL_09272006_0725)
#define BOOST_FUSION_IS_VIEW_IMPL_09272006_0725
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct boost_tuple_tag;
namespace extension
{
template<typename Tag>
struct is_view_impl;
template<>
struct is_view_impl<boost_tuple_tag>
{
template<typename T>
struct apply : mpl::false_ {};
};
}
}}
#endif

View File

@@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_SIZE_IMPL_09272006_0724)
#define BOOST_FUSION_SIZE_IMPL_09272006_0724
#include <boost/tuple/tuple.hpp>
#include <boost/mpl/int.hpp>
namespace boost { namespace fusion
{
struct boost_tuple_tag;
namespace extension
{
template<typename T>
struct size_impl;
template <>
struct size_impl<boost_tuple_tag>
{
template <typename Sequence>
struct apply : mpl::int_<tuples::length<Sequence>::value> {};
};
}
}}
#endif

View File

@@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_VALUE_AT_IMPL_09262006_1926)
#define BOOST_FUSION_VALUE_AT_IMPL_09262006_1926
#include <boost/tuple/tuple.hpp>
namespace boost { namespace fusion
{
struct boost_tuple_tag;
namespace extension
{
template<typename T>
struct value_at_impl;
template <>
struct value_at_impl<boost_tuple_tag>
{
template <typename Sequence, typename N>
struct apply : tuples::element<N::value, Sequence> {};
};
}
}}
#endif

View File

@@ -0,0 +1,114 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_TAG_OF_09262006_1900)
#define BOOST_FUSION_TAG_OF_09262006_1900
#include <boost/fusion/support/tag_of_fwd.hpp>
namespace boost { namespace tuples
{
struct null_type;
template <
class T0, class T1, class T2, class T3, class T4,
class T5, class T6, class T7, class T8, class T9
>
class tuple;
template <class Head, class Tail>
struct cons;
}}
namespace boost { namespace fusion
{
struct boost_tuple_tag;
struct fusion_sequence_tag;
namespace traits
{
template <
class T0, class T1, class T2, class T3, class T4,
class T5, class T6, class T7, class T8, class T9
>
#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
struct tag_of<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>, void >
#else
struct tag_of<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
#endif
{
typedef boost_tuple_tag type;
};
template <class Head, class Tail>
#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
struct tag_of<tuples::cons<Head, Tail>, void >
#else
struct tag_of<tuples::cons<Head, Tail> >
#endif
{
typedef boost_tuple_tag type;
};
template <>
struct tag_of<tuples::null_type>
{
typedef boost_tuple_tag type;
};
}
}}
namespace boost { namespace mpl
{
template<typename>
struct sequence_tag;
template <
class T0, class T1, class T2, class T3, class T4,
class T5, class T6, class T7, class T8, class T9
>
struct sequence_tag<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> >
{
typedef fusion::fusion_sequence_tag type;
};
template <
class T0, class T1, class T2, class T3, class T4,
class T5, class T6, class T7, class T8, class T9
>
struct sequence_tag<
tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> const
>
{
typedef fusion::fusion_sequence_tag type;
};
template <class Head, class Tail>
struct sequence_tag<tuples::cons<Head, Tail> >
{
typedef fusion::fusion_sequence_tag type;
};
template <class Head, class Tail>
struct sequence_tag<tuples::cons<Head, Tail> const>
{
typedef fusion::fusion_sequence_tag type;
};
template <>
struct sequence_tag<tuples::null_type>
{
typedef fusion::fusion_sequence_tag type;
};
template <>
struct sequence_tag<tuples::null_type const>
{
typedef fusion::fusion_sequence_tag type;
};
}}
#endif

View File

@@ -0,0 +1,22 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_MPL_31122005_1152)
#define BOOST_FUSION_MPL_31122005_1152
#include <boost/fusion/adapted/mpl/detail/begin_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/end_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/size_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/value_at_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/at_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/has_key_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/category_of_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/is_view_impl.hpp>
#include <boost/fusion/adapted/mpl/detail/empty_impl.hpp>
#endif

View File

@@ -0,0 +1,40 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_AT_IMPL_31122005_1642)
#define BOOST_FUSION_AT_IMPL_31122005_1642
#include <boost/mpl/at.hpp>
namespace boost { namespace fusion
{
struct mpl_sequence_tag;
namespace extension
{
template<typename Tag>
struct at_impl;
template <>
struct at_impl<mpl_sequence_tag>
{
template <typename Sequence, typename N>
struct apply
{
typedef typename mpl::at<Sequence, N>::type type;
static type
call(Sequence)
{
return type();
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,45 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_BEGIN_IMPL_31122005_1209)
#define BOOST_FUSION_BEGIN_IMPL_31122005_1209
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
#include <boost/mpl/begin.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion {
struct mpl_sequence_tag;
namespace extension
{
template <typename Tag>
struct begin_impl;
template <>
struct begin_impl<mpl_sequence_tag>
{
template <typename Sequence>
struct apply
{
typedef typename mpl::begin<
typename remove_const<Sequence>::type
>::type iterator;
typedef mpl_iterator<iterator> type;
static type
call(Sequence)
{
return type();
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,54 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_CATEGORY_OF_IMPL_20060217_2141)
#define BOOST_FUSION_CATEGORY_OF_IMPL_20060217_2141
#include <boost/fusion/support/detail/mpl_iterator_category.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/static_assert.hpp>
namespace boost { namespace fusion {
namespace detail
{
template <typename T>
struct mpl_sequence_category_of
{
// assumes T is an mpl sequence
// there should be no way this will ever be
// called where T is an mpl iterator
BOOST_STATIC_ASSERT(mpl::is_sequence<T>::value);
typedef typename
mpl_iterator_category<
typename mpl::begin<T>::type::category
>::type
type;
};
}
struct mpl_sequence_tag;
namespace extension
{
template<typename Tag>
struct category_of_impl;
template<>
struct category_of_impl<mpl_sequence_tag>
{
template<typename T>
struct apply
: detail::mpl_sequence_category_of<T>
{};
};
}
}}
#endif

View File

@@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_EMPTY_IMPL_31122005_1554)
#define BOOST_FUSION_EMPTY_IMPL_31122005_1554
#include <boost/mpl/empty.hpp>
namespace boost { namespace fusion
{
struct mpl_sequence_tag;
namespace extension
{
template <typename Sequence>
struct empty_impl;
template <>
struct empty_impl<mpl_sequence_tag>
{
template <typename Sequence>
struct apply : mpl::empty<Sequence> {};
};
}
}}
#endif

View File

@@ -0,0 +1,45 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_END_IMPL_31122005_1237)
#define BOOST_FUSION_END_IMPL_31122005_1237
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
#include <boost/mpl/end.hpp>
#include <boost/type_traits/add_const.hpp>
namespace boost { namespace fusion
{
struct mpl_sequence_tag;
namespace extension
{
template <typename Tag>
struct end_impl;
template <>
struct end_impl<mpl_sequence_tag>
{
template <typename Sequence>
struct apply
{
typedef typename mpl::end<
typename remove_const<Sequence>::type
>::type iterator;
typedef mpl_iterator<iterator> type;
static type
call(Sequence)
{
return type();
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_HAS_KEY_IMPL_31122005_1647)
#define BOOST_FUSION_HAS_KEY_IMPL_31122005_1647
#include <boost/mpl/has_key.hpp>
namespace boost { namespace fusion
{
struct mpl_sequence_tag;
namespace extension
{
template <typename Tag>
struct has_key_impl;
template <>
struct has_key_impl<mpl_sequence_tag>
{
template <typename Sequence, typename Key>
struct apply : mpl::has_key<Sequence, Key> {};
};
}
}}
#endif

View File

@@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_IS_SEQUENCE_IMPL_31122005_1505)
#define BOOST_FUSION_IS_SEQUENCE_IMPL_31122005_1505
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct mpl_sequence_tag;
namespace extension
{
template<typename Tag>
struct is_sequence_impl;
template<>
struct is_sequence_impl<mpl_sequence_tag>
{
template<typename T>
struct apply : mpl::true_ {};
};
}
}}
#endif

View File

@@ -0,0 +1,32 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_IS_VIEW_IMPL_03202006_0048)
#define BOOST_FUSION_IS_VIEW_IMPL_03202006_0048
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct mpl_sequence_tag;
namespace extension
{
template<typename Tag>
struct is_view_impl;
template<>
struct is_view_impl<mpl_sequence_tag>
{
template<typename T>
struct apply : mpl::true_
{};
};
}
}}
#endif

View File

@@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_SIZE_IMPL_31122005_1508)
#define BOOST_FUSION_SIZE_IMPL_31122005_1508
#include <boost/mpl/size.hpp>
namespace boost { namespace fusion
{
struct mpl_sequence_tag;
namespace extension
{
template<typename Tag>
struct size_impl;
template <>
struct size_impl<mpl_sequence_tag>
{
template <typename Sequence>
struct apply : mpl::size<Sequence> {};
};
}
}}
#endif

View File

@@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_VALUE_AT_IMPL_31122005_1621)
#define BOOST_FUSION_VALUE_AT_IMPL_31122005_1621
#include <boost/mpl/at.hpp>
namespace boost { namespace fusion
{
struct mpl_sequence_tag;
namespace extension
{
template <typename Tag>
struct value_at_impl;
template <>
struct value_at_impl<mpl_sequence_tag>
{
template <typename Sequence, typename N>
struct apply : mpl::at<Sequence, N> {};
};
}
}}
#endif

View File

@@ -0,0 +1,113 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_MPL_ITERATOR_05052005_0731)
#define FUSION_MPL_ITERATOR_05052005_0731
#include <boost/fusion/support/detail/mpl_iterator_category.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/prior.hpp>
#include <boost/mpl/advance.hpp>
#include <boost/mpl/distance.hpp>
namespace boost { namespace fusion
{
template <typename Iterator_>
struct mpl_iterator
: iterator_facade<
mpl_iterator<Iterator_>
, typename detail::mpl_iterator_category<typename Iterator_::category>::type
>
{
typedef typename remove_const<Iterator_>::type iterator_type;
template <typename Iterator>
struct value_of : mpl::deref<typename Iterator::iterator_type> {};
template <typename Iterator>
struct deref
{
typedef typename mpl::deref<
typename Iterator::iterator_type>::type
type;
static type
call(Iterator)
{
return type();
}
};
template <typename Iterator>
struct next
{
typedef mpl_iterator<
typename mpl::next<typename Iterator::iterator_type>::type>
type;
static type
call(Iterator)
{
return type();
}
};
template <typename Iterator>
struct prior
{
typedef mpl_iterator<
typename mpl::prior<typename Iterator::iterator_type>::type>
type;
static type
call(Iterator)
{
return type();
}
};
template <typename Iterator, typename N>
struct advance
{
typedef mpl_iterator<
typename mpl::advance<typename Iterator::iterator_type, N>::type>
type;
static type
call(Iterator const& /*i*/)
{
return type();
}
};
template <typename I1, typename I2>
struct distance :
mpl::distance<
typename I1::iterator_type
, typename I2::iterator_type>
{
typedef typename
mpl::distance<
typename I1::iterator_type
, typename I2::iterator_type
>::type
type;
static type
call(I1 const&, I2 const&)
{
return type();
}
};
};
}}
#endif

View File

@@ -0,0 +1,19 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STD_PAIR_HPP
#define BOOST_FUSION_ADAPTED_STD_PAIR_HPP
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <utility>
BOOST_FUSION_ADAPT_TPL_STRUCT(
(T1)(T2),(std::pair)(T1)(T2),(T1, first)(T2, second))
#endif

View File

@@ -0,0 +1,21 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_BOOST_TUPLE_09242011_1744)
#define BOOST_FUSION_BOOST_TUPLE_09242011_1744
#include <boost/fusion/adapted/std_tuple/detail/is_view_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/is_sequence_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/category_of_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/begin_impl.hpp>
#include <boost/fusion/adapted/std_tuple/detail/end_impl.hpp>
#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/std_tuple_iterator.hpp>
#include <boost/fusion/adapted/std_tuple/tag_of.hpp>
#endif

View File

@@ -0,0 +1,52 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_AT_IMPL_09242011_1744)
#define BOOST_FUSION_AT_IMPL_09242011_1744
#include <tuple>
#include <utility>
#include <boost/mpl/eval_if.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct at_impl;
template <>
struct at_impl<std_tuple_tag>
{
template <typename Sequence, typename N>
struct apply
{
typedef typename remove_const<Sequence>::type seq_type;
typedef std::tuple_element<N::value, seq_type> element;
typedef typename
mpl::eval_if<
is_const<Sequence>
, fusion::detail::cref_result<element>
, fusion::detail::ref_result<element>
>::type
type;
static type
call(Sequence& seq)
{
return std::get<N::value>(seq);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,39 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_BEGIN_IMPL_09242011_1744)
#define BOOST_FUSION_BEGIN_IMPL_09242011_1744
#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct begin_impl;
template <>
struct begin_impl<std_tuple_tag>
{
template <typename Sequence>
struct apply
{
typedef std_tuple_iterator<Sequence, 0> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,32 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_CATEGORY_OF_IMPL_09272006_0726)
#define BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726
namespace boost { namespace fusion
{
struct std_tuple_tag;
struct random_access_traversal_tag;
namespace extension
{
template<typename T>
struct category_of_impl;
template<>
struct category_of_impl<std_tuple_tag>
{
template<typename T>
struct apply
{
typedef random_access_traversal_tag type;
};
};
}
}}
#endif

View File

@@ -0,0 +1,43 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_END_IMPL_09242011_1744)
#define BOOST_FUSION_END_IMPL_09242011_1744
#include <boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <tuple>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct end_impl;
template <>
struct end_impl<std_tuple_tag>
{
template <typename Sequence>
struct apply
{
typedef typename remove_const<Sequence>::type seq_type;
static int const size = std::tuple_size<seq_type>::value;
typedef std_tuple_iterator<Sequence, size> type;
static type
call(Sequence& v)
{
return type(v);
}
};
};
}
}}
#endif

View File

@@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_IS_SEQUENCE_IMPL_09242011_1744)
#define BOOST_FUSION_IS_SEQUENCE_IMPL_09242011_1744
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename Tag>
struct is_sequence_impl;
template<>
struct is_sequence_impl<std_tuple_tag>
{
template<typename Sequence>
struct apply : mpl::true_ {};
};
}
}}
#endif

View File

@@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_IS_VIEW_IMPL_09242011_1744)
#define BOOST_FUSION_IS_VIEW_IMPL_09242011_1744
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename Tag>
struct is_view_impl;
template<>
struct is_view_impl<std_tuple_tag>
{
template<typename T>
struct apply : mpl::false_ {};
};
}
}}
#endif

View File

@@ -0,0 +1,36 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_SIZE_IMPL_09242011_1744)
#define BOOST_FUSION_SIZE_IMPL_09242011_1744
#include <tuple>
#include <boost/mpl/int.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct size_impl;
template <>
struct size_impl<std_tuple_tag>
{
template <typename Sequence>
struct apply :
mpl::int_<std::tuple_size<
typename remove_const<Sequence>::type>::value
>
{};
};
}
}}
#endif

View File

@@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_VALUE_AT_IMPL_09242011_1744)
#define BOOST_FUSION_VALUE_AT_IMPL_09242011_1744
#include <tuple>
namespace boost { namespace fusion
{
struct std_tuple_tag;
namespace extension
{
template<typename T>
struct value_at_impl;
template <>
struct value_at_impl<std_tuple_tag>
{
template <typename Sequence, typename N>
struct apply : std::tuple_element<N::value, Sequence> {};
};
}
}}
#endif

View File

@@ -0,0 +1,107 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_STD_TUPLE_ITERATOR_09112011_1905)
#define FUSION_STD_TUPLE_ITERATOR_09112011_1905
#include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/eval_if.hpp>
#include <tuple>
#include <utility>
namespace boost { namespace fusion
{
struct random_access_traversal_tag;
template <typename Tuple, int Index>
struct std_tuple_iterator_identity;
template <typename Tuple, int Index>
struct std_tuple_iterator
: iterator_facade<
std_tuple_iterator<Tuple, Index>
, random_access_traversal_tag>
{
typedef Tuple tuple_type;
static int const index = Index;
typedef std_tuple_iterator_identity<
typename add_const<Tuple>::type, Index>
identity;
explicit std_tuple_iterator(Tuple& tuple)
: tuple(tuple) {}
Tuple& tuple;
template <typename Iterator>
struct value_of
: std::tuple_element<Iterator::index,
typename remove_const<typename Iterator::tuple_type>::type> {};
template <typename Iterator>
struct deref
{
typedef value_of<Iterator> element;
typedef typename
mpl::eval_if<
is_const<typename Iterator::tuple_type>
, fusion::detail::cref_result<element>
, fusion::detail::ref_result<element>
>::type
type;
static type
call(Iterator const& iter)
{
return std::get<Index>(iter.tuple);
}
};
template <typename Iterator, typename N>
struct advance
{
static int const index = Iterator::index;
typedef typename Iterator::tuple_type tuple_type;
typedef std_tuple_iterator<tuple_type, index+N::value> type;
static type
call(Iterator const& i)
{
return type(i.tuple);
}
};
template <typename Iterator>
struct next : advance<Iterator, mpl::int_<1>> {};
template <typename Iterator>
struct prior : advance<Iterator, mpl::int_<-1>> {};
template <typename I1, typename I2>
struct equal_to
: is_same<typename I1::identity, typename I2::identity> {};
template <typename First, typename Last>
struct distance
{
typedef mpl::int_<Last::index-First::index> type;
static type
call(First const&, Last const&)
{
return type();
}
};
};
}}
#endif

View File

@@ -0,0 +1,52 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_TAG_OF_09112011_1842)
#define BOOST_FUSION_TAG_OF_09112011_1842
#include <tuple>
#include <boost/fusion/support/tag_of_fwd.hpp>
namespace std
{
template <typename... Elements>
class tuple;
}
namespace boost { namespace fusion
{
struct std_tuple_tag;
struct fusion_sequence_tag;
namespace traits
{
template <typename... Elements>
struct tag_of<std::tuple<Elements...>>
{
typedef std_tuple_tag type;
};
}
}}
namespace boost { namespace mpl
{
template <typename>
struct sequence_tag;
template <typename... Elements>
struct sequence_tag<std::tuple<Elements...>>
{
typedef fusion::fusion_sequence_tag type;
};
template <typename... Elements>
struct sequence_tag<std::tuple<Elements...> const>
{
typedef fusion::fusion_sequence_tag type;
};
}}
#endif

View File

@@ -0,0 +1,20 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_HPP
#include <boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp>
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
#include <boost/fusion/adapted/struct/adapt_struct_named.hpp>
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
#include <boost/fusion/adapted/struct/define_struct.hpp>
#endif

View File

@@ -0,0 +1,96 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Copyright (c) 2007 Dan Marsden
Copyright (c) 2009-2011 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_STRUCT_ADAPT_ASSOC_STRUCT_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_ASSOC_STRUCT_HPP
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/empty.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/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>
#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) \
\
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, PREFIX, ATTRIBUTE, 3) \
\
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; \
};
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \
\
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE)
#define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \
TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \
\
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(1)TEMPLATE_PARAMS_SEQ, \
(1)NAME_SEQ, \
assoc_struct_tag, \
0, \
BOOST_PP_CAT( \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT(NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(0), \
(0)(NAME), \
assoc_struct_tag, \
0, \
BOOST_PP_CAT( \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_STRUCT_BASE( \
(0), \
(0)(NAME), \
assoc_struct_tag, \
1, \
BOOST_PP_CAT( \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
#endif

View File

@@ -0,0 +1,37 @@
/*=============================================================================
Copyright (c) 2010-2011 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_STRUCT_ADAPT_ASSOC_STRUCT_NAMED_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_ASSOC_STRUCT_NAMED_HPP
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0(X, Y, Z) \
(X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1(X, Y, Z) \
(X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0_END
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1_END
#define BOOST_FUSION_ADAPT_ASSOC_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_ASSOC_STRUCT_AS_VIEW( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
BOOST_PP_CAT( \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 ATTRIBUTES, \
_END))
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
#endif

View File

@@ -0,0 +1,71 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Copyright (c) 2009-2011 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_STRUCT_ADAPT_STRUCT_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP
#include <boost/preprocessor/cat.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>
#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)
#endif

View File

@@ -0,0 +1,39 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Copyright (c) 2009-2010 Hartmut Kaiser
Copyright (c) 2010-2011 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_STRUCT_ADAPT_STRUCT_NAMED_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_NAMED_HPP
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#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) \
\
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)
#endif

View File

@@ -0,0 +1,43 @@
/*=============================================================================
Copyright (c) 2010-2011 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_STRUCT_DEFINE_ASSOC_STRUCT_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DEFINE_ASSOC_STRUCT_HPP
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
#include <boost/fusion/adapted/struct/detail/define_struct.hpp>
#define BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT( \
TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
\
BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, \
(0)NAMESPACE_SEQ, \
NAME, \
BOOST_PP_CAT( \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \
3) \
\
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \
TEMPLATE_PARAMS_SEQ, \
(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME)\
TEMPLATE_PARAMS_SEQ, \
ATTRIBUTES)
#define BOOST_FUSION_DEFINE_ASSOC_STRUCT(NAMESPACE_SEQ, NAME, ATTRIBUTES) \
BOOST_FUSION_DEFINE_STRUCT_IMPL( \
(0)NAMESPACE_SEQ, \
NAME, \
BOOST_PP_CAT( \
BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \
3) \
\
BOOST_FUSION_ADAPT_ASSOC_STRUCT( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME, \
ATTRIBUTES)
#endif

View File

@@ -0,0 +1,41 @@
/*=============================================================================
Copyright (c) 2010-2011 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_STRUCT_DEFINE_STRUCT_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DEFINE_STRUCT_HPP
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/fusion/adapted/struct/detail/define_struct.hpp>
#define BOOST_FUSION_DEFINE_TPL_STRUCT( \
TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
\
BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, \
(0)NAMESPACE_SEQ, \
NAME, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
2) \
\
BOOST_FUSION_ADAPT_TPL_STRUCT( \
TEMPLATE_PARAMS_SEQ, \
(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME)\
TEMPLATE_PARAMS_SEQ, \
ATTRIBUTES)
#define BOOST_FUSION_DEFINE_STRUCT(NAMESPACE_SEQ, NAME, ATTRIBUTES) \
BOOST_FUSION_DEFINE_STRUCT_IMPL( \
(0)NAMESPACE_SEQ, \
NAME, \
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \
2) \
\
BOOST_FUSION_ADAPT_STRUCT( \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME, \
ATTRIBUTES)
#endif

View File

@@ -0,0 +1,245 @@
/*=============================================================================
Copyright (c) 2001-2009 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-2011 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_STRUCT_DETAIL_ADAPT_BASE_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_HPP
#include <boost/config.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/seq/size.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/arithmetic/dec.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>
#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()
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(SEQ) \
BOOST_PP_IF( \
BOOST_PP_SEQ_HEAD(SEQ), \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS, \
BOOST_PP_SEQ_HEAD)(BOOST_PP_SEQ_TAIL(SEQ))
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL_C(R, _, ELEM) \
(typename ELEM)
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL(SEQ) \
BOOST_PP_SEQ_ENUM( \
BOOST_PP_SEQ_FOR_EACH( \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL_C, \
_, \
BOOST_PP_SEQ_TAIL(SEQ)))
#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(SEQ) \
BOOST_PP_IF( \
BOOST_PP_SEQ_HEAD(SEQ), \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \
BOOST_PP_TUPLE_EAT(1))(SEQ)
#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
> \
struct tag_of< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) MODIFIER \
, void \
> \
{ \
typedef TAG type; \
};
#else
# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
> \
struct tag_of<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) MODIFIER> \
{ \
typedef TAG type; \
};
#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), \
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 access::struct_member< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
, I \
> \
{ \
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 \
{ \
typedef typename \
add_reference< \
typename mpl::eval_if< \
is_const<Seq> \
, add_const<attribute_type> \
, mpl::identity<attribute_type> \
>::type \
>::type \
type; \
\
static type \
call(Seq& 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 BOOST_PP_STRINGIZE( \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)); \
} \
};
#define BOOST_FUSION_ADAPT_STRUCT_BASE( \
TEMPLATE_PARAMS_SEQ, \
NAME_SEQ, \
TAG, \
IS_VIEW, \
ATTRIBUTES_SEQ, \
ATTRIBUTES_CALLBACK) \
\
namespace boost \
{ \
namespace fusion \
{ \
namespace traits \
{ \
BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
BOOST_PP_EMPTY(), TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \
const, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \
} \
\
namespace extension \
{ \
BOOST_PP_IF( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_PP_SEQ_FOR_EACH_I_R, \
BOOST_PP_TUPLE_EAT(4))( \
1, \
BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \
(ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ), \
BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ)) \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
> \
struct struct_size<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)> \
: mpl::int_<BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ))> \
{}; \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
> \
struct struct_is_view< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
> \
: mpl::BOOST_PP_IF(IS_VIEW,true_,false_) \
{}; \
} \
} \
\
namespace mpl \
{ \
template<typename> \
struct sequence_tag; \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
> \
struct sequence_tag<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)> \
{ \
typedef fusion::fusion_sequence_tag type; \
}; \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
TEMPLATE_PARAMS_SEQ) \
> \
struct sequence_tag< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const \
> \
{ \
typedef fusion::fusion_sequence_tag type; \
}; \
} \
}
#endif

View File

@@ -0,0 +1,38 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_DETAIL_AT_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_AT_IMPL_HPP
#include <boost/mpl/int.hpp>
namespace boost { namespace fusion { namespace extension
{
template<typename>
struct at_impl;
template <>
struct at_impl<struct_tag>
{
template <typename Seq, typename N>
struct apply
: access::struct_member<
typename remove_const<Seq>::type
, N::value
>::template apply<Seq>
{};
};
template <>
struct at_impl<assoc_struct_tag>
: at_impl<struct_tag>
{};
}}}
#endif

View File

@@ -0,0 +1,67 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_DETAIL_BEGIN_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_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<struct_tag>
{
template <typename Seq>
struct apply
{
typedef
basic_iterator<
struct_iterator_tag
, random_access_traversal_tag
, Seq
, 0
>
type;
static type
call(Seq& seq)
{
return type(seq,0);
}
};
};
template <>
struct begin_impl<assoc_struct_tag>
{
template <typename Seq>
struct apply
{
typedef
basic_iterator<
struct_iterator_tag
, assoc_struct_category
, Seq
, 0
>
type;
static type
call(Seq& seq)
{
return type(seq,0);
}
};
};
}}}
#endif

View File

@@ -0,0 +1,42 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_DETAIL_CATEGORY_OF_IMPL_HPP
#define 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<struct_tag>
{
template<typename Seq>
struct apply
{
typedef random_access_traversal_tag type;
};
};
template<>
struct category_of_impl<assoc_struct_tag>
{
template<typename Seq>
struct apply
{
typedef assoc_struct_category type;
};
};
}
}}
#endif

View File

@@ -0,0 +1,353 @@
/*=============================================================================
Copyright (c) 2010-2011 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_STRUCT_DEFINE_STRUCT_HPP
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEFINE_STRUCT_HPP
#include <boost/config.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/adapted/struct/detail/adapt_base.hpp>
#include <boost/fusion/adapted/struct/detail/namespace.hpp>
#include <boost/preprocessor/inc.hpp>
#include <boost/preprocessor/if.hpp>
#include <boost/preprocessor/expr_if.hpp>
#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/logical/not.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/comparison/equal.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_i.hpp>
#include <boost/preprocessor/seq/enum.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#include <boost/call_traits.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/utility/enable_if.hpp>
#define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \
\
BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \
other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE))
#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I_, ATTRIBUTE) \
\
BOOST_PP_EXPR_IF( \
I_, \
typedef typename \
boost::fusion::result_of::next< \
BOOST_PP_CAT(I,BOOST_PP_DEC(I_)) \
>::type \
BOOST_PP_CAT(I,I_); \
BOOST_PP_CAT(I,I_) BOOST_PP_CAT(i,I_)= \
boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_))); \
) \
\
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)= \
boost::fusion::deref(BOOST_PP_CAT(i,I_));
#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
template<typename Seq> \
self_type& \
operator=(Seq const& seq) \
{ \
typedef typename \
boost::fusion::result_of::begin<Seq const>::type \
I0; \
I0 i0=boost::fusion::begin(seq); \
\
BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ) \
\
return *this; \
}
#define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPEL_SIZE, ATTRIBUTE) \
\
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,0,ATTRIBUTE) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE);
#define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \
\
BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \
boost::fusion::deref(boost::fusion::advance_c<I>(boost::fusion::begin( \
seq))))
#define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
, typename boost::disable_if< \
boost::is_convertible< \
Seq const& \
, BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE, \
0, \
BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
> \
>::type* =0
#define BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \
\
BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)()
#define BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_PP_SEQ_FOR_EACH_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_ATTR_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ) \
\
NAME() \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ) \
{} \
\
NAME(self_type const& other_self) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ) \
{} \
\
template<typename Seq> \
NAME(Seq const& seq \
BOOST_PP_IF( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_PP_TUPLE_EAT(2), \
BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER)( \
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ) \
{} \
\
BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE)
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
explicit \
NAME(boost::call_traits< \
BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE,0,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
>::param_type arg) \
: BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \
{}
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
explicit \
NAME(typename boost::call_traits< \
typename boost::fusion::detail::get_first_arg< \
BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE, \
0, \
BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \
, BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \
>::type \
>::param_type arg) \
: BOOST_PP_TUPLE_ELEM( \
ATTRIBUTE_TUPEL_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \
{}
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \
\
BOOST_PP_COMMA_IF(I) \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)(BOOST_PP_CAT(_,I))
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I(R, DATA, I, ATTRIBUTE) \
\
BOOST_PP_COMMA_IF(I) \
typename boost::call_traits< \
typename boost::fusion::detail::get_first_arg< \
BOOST_PP_TUPLE_ELEM( \
BOOST_PP_TUPLE_ELEM(3,0,DATA), \
0, \
ATTRIBUTE) \
, BOOST_PP_TUPLE_ELEM(3,2,DATA) \
>::type \
>::param_type BOOST_PP_CAT(_,I)
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \
( \
ATTRIBUTE_TUPEL_SIZE, \
BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \
), \
ATTRIBUTES_SEQ)) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ) \
{}
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I( \
R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \
\
BOOST_PP_COMMA_IF(I) \
boost::call_traits< \
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,0,ATTRIBUTE) \
>::param_type BOOST_PP_CAT(_,I)
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ)) \
: BOOST_PP_SEQ_FOR_EACH_I_R( \
1, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \
ATTRIBUTE_TUPEL_SIZE, \
ATTRIBUTES_SEQ) \
{}
#define BOOST_FUSION_DEFINE_STRUCT_CTOR( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_STRUCT_CTOR_N, \
BOOST_FUSION_DEFINE_STRUCT_CTOR_1)( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE)
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N, \
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1)( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE)
#define BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_FUSION_DEFINE_STRUCT_CTOR( \
NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPEL_SIZE)
#define BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
template<typename Seq> \
NAME(Seq const&) \
{} \
\
template<typename Seq> \
self_type& \
operator=(Seq const& seq) \
{ \
return *this; \
}
#define BOOST_FUSION_DEFINE_STRUCT_IMPL( \
NAMESPACE_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
\
struct NAME \
{ \
typedef NAME self_type; \
\
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_NONEMPTY_STRUCT_IMPL, \
BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL)( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
}; \
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)
#define BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
NAME, BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR( \
TEMPLATE_PARAMS_SEQ, \
NAME, \
BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ), \
ATTRIBUTE_TUPEL_SIZE)
#define BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_FUSION_DEFINE_EMPTY_STRUCT_IMPL( \
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE)
#define BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \
TEMPLATE_PARAMS_SEQ, \
NAMESPACE_SEQ, \
NAME, \
ATTRIBUTES_SEQ, \
ATTRIBUTE_TUPEL_SIZE) \
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
\
template< \
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL( \
(0)TEMPLATE_PARAMS_SEQ) \
> \
struct NAME \
{ \
typedef NAME self_type; \
\
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
BOOST_FUSION_DEFINE_NONEMPTY_TPL_STRUCT_IMPL, \
BOOST_FUSION_DEFINE_EMPTY_TPL_STRUCT_IMPL)( \
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE)\
}; \
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)
namespace boost { namespace fusion { namespace detail
{
template<typename A1, typename A2>
struct get_first_arg
{
typedef A1 type;
};
}}}
#endif

View File

@@ -0,0 +1,22 @@
/*=============================================================================
Copyright (c) 2009-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_STRUCT_DETAIL_DEREF_DATA_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_DATA_IMPL_HPP
namespace boost { namespace fusion { namespace extension
{
template <typename>
struct deref_data_impl;
template <>
struct deref_data_impl<struct_iterator_tag>
: deref_impl<struct_iterator_tag>
{};
}}}
#endif

View File

@@ -0,0 +1,41 @@
/*=============================================================================
Copyright (c) 2009-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_STRUCT_DETAIL_DEREF_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_IMPL_HPP
namespace boost { namespace fusion { namespace extension
{
template <typename>
struct deref_impl;
template <>
struct deref_impl<struct_iterator_tag>
{
template <typename It>
struct apply
{
typedef typename
access::struct_member<
typename remove_const<typename It::seq_type>::type
, It::index::value
>::template apply<typename It::seq_type>
impl;
typedef typename impl::type type;
static
type
call(It const& it)
{
return impl::call(*it.seq);
}
};
};
}}}
#endif

View File

@@ -0,0 +1,67 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_DETAIL_END_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP
#include <boost/fusion/iterator/basic_iterator.hpp>
namespace boost { namespace fusion { namespace extension
{
template <typename>
struct end_impl;
template <>
struct end_impl<struct_tag>
{
template <typename Seq>
struct apply
{
typedef
basic_iterator<
struct_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_struct_tag>
{
template <typename Seq>
struct apply
{
typedef
basic_iterator<
struct_iterator_tag
, assoc_struct_category
, Seq
, struct_size<typename remove_const<Seq>::type>::value
>
type;
static type
call(Seq& seq)
{
return type(seq,0);
}
};
};
}}}
#endif

View File

@@ -0,0 +1,57 @@
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_DETAIL_EXTENSION_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_EXTENSION_HPP
#include <boost/fusion/support/category_of.hpp>
namespace boost { namespace fusion
{
struct struct_tag;
struct struct_iterator_tag;
struct assoc_struct_tag;
struct fusion_sequence_tag;
struct assoc_struct_category
: random_access_traversal_tag, associative_tag
{};
namespace extension
{
struct no_such_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;
template<typename Seq>
struct struct_size;
template<typename Seq>
struct struct_is_view;
template<typename Seq, int N>
struct struct_assoc_key;
}
}}
#endif

View File

@@ -0,0 +1,35 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_DETAIL_IS_SEQUENCE_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_SEQUENCE_IMPL_HPP
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion { namespace extension
{
template<typename>
struct is_sequence_impl;
template<>
struct is_sequence_impl<struct_tag>
{
template<typename Seq>
struct apply
: mpl::true_
{};
};
template <>
struct is_sequence_impl<assoc_struct_tag>
: is_sequence_impl<struct_tag>
{};
}}}
#endif

View File

@@ -0,0 +1,33 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_DETAIL_IS_VIEW_IMPL_HPP
#define 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<struct_tag>
{
template<typename Seq>
struct apply
: struct_is_view<typename remove_const<Seq>::type>
{};
};
template <>
struct is_view_impl<assoc_struct_tag>
: is_view_impl<struct_tag>
{};
}}}
#endif

View File

@@ -0,0 +1,29 @@
/*=============================================================================
Copyright (c) 2009-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_STRUCT_DETAIL_KEY_OF_IMPL_HPP
#define 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<struct_iterator_tag>
{
template <typename It>
struct apply
: extension::struct_assoc_key<
typename remove_const<typename It::seq_type>::type
, It::index::value
>
{};
};
}}}
#endif

View File

@@ -0,0 +1,51 @@
/*=============================================================================
Copyright (c) 2009-2010 Hartmut Kaiser
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_STRUCT_NAMESPACE_HPP
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_NAMESPACE_HPP
#include <boost/preprocessor/dec.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/seq/seq.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/size.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/tuple/eat.hpp>
#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_BEGIN_I(R,DATA,ELEM) \
namespace ELEM {
#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_END_I(Z,I,DATA) }
#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I(Z,I,ELEM) ELEM::
#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
BOOST_PP_IF( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
BOOST_PP_SEQ_FOR_EACH_R, \
BOOST_PP_TUPLE_EAT(4))( \
1, \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_BEGIN_I, \
_, \
BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ))
#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) \
BOOST_PP_REPEAT_1( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_END_I, \
_)
#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ) \
BOOST_PP_IF( \
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
BOOST_PP_SEQ_FOR_EACH_R, \
BOOST_PP_TUPLE_EAT(4))( \
1, \
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I, \
_, \
BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ))
#endif

View File

@@ -0,0 +1,39 @@
/*=============================================================================
Copyright (c) 2009-2010 Hartmut Kaiser
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_STRUCT_PROXY_TYPE_HPP
#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_PROXY_TYPE_HPP
#include <boost/fusion/adapted/struct/detail/namespace.hpp>
#define BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
WRAPPED_TYPE,NAMESPACE_SEQ,NAME) \
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
\
struct NAME \
{ \
NAME(WRAPPED_TYPE& in_obj) \
: obj(in_obj) \
{} \
\
WRAPPED_TYPE& obj; \
\
private: \
NAME& operator= (NAME const&); \
}; \
\
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)
#define BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE( \
WRAPPED_TYPE, NAMESPACE_SEQ, NAME) \
\
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
WRAPPED_TYPE, (0)NAMESPACE_SEQ, NAME)
#endif

View File

@@ -0,0 +1,33 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_DETAIL_SIZE_IMPL_HPP
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_SIZE_IMPL_HPP
namespace boost { namespace fusion { namespace extension
{
template<typename>
struct size_impl;
template <>
struct size_impl<struct_tag>
{
template <typename Seq>
struct apply
: struct_size<typename remove_const<Seq>::type>
{};
};
template <>
struct size_impl<assoc_struct_tag>
: size_impl<struct_tag>
{};
}}}
#endif

View File

@@ -0,0 +1,33 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
Copyright (c) 2009-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_STRUCT_DETAIL_VALUE_AT_IMPL_HPP
#define 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<struct_tag>
{
template <typename Seq, typename N>
struct apply
: access::struct_member<typename remove_const<Seq>::type, N::value>
{};
};
template <>
struct value_at_impl<assoc_struct_tag>
: value_at_impl<struct_tag>
{};
}}}
#endif

View File

@@ -0,0 +1,22 @@
/*=============================================================================
Copyright (c) 2009-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_STRUCT_DETAIL_VALUE_OF_DATA_IMPL_HPP
#define 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<struct_iterator_tag>
: value_of_impl<struct_iterator_tag>
{};
}}}
#endif

View File

@@ -0,0 +1,29 @@
/*=============================================================================
Copyright (c) 2009-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_STRUCT_DETAIL_VALUE_OF_IMPL_HPP
#define 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<struct_iterator_tag>
{
template <typename It>
struct apply
: access::struct_member<
typename remove_const<typename It::seq_type>::type
, It::index::value
>
{};
};
}}}
#endif

View File

@@ -0,0 +1,14 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_ALGORITHM_10022005_0549)
#define FUSION_ALGORITHM_10022005_0549
#include <boost/fusion/algorithm/iteration.hpp>
#include <boost/fusion/algorithm/query.hpp>
#include <boost/fusion/algorithm/transformation.hpp>
#endif

View File

@@ -0,0 +1,12 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_ALGORITHM_AUXILIARY_02192011_0907)
#define FUSION_ALGORITHM_AUXILIARY_02192011_0907
#include <boost/fusion/algorithm/auxiliary/copy.hpp>
#endif

View File

@@ -0,0 +1,73 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_COPY_02162011_2308)
#define FUSION_COPY_02162011_2308
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/comparison/detail/equal_to.hpp>
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#if defined (BOOST_MSVC)
# pragma warning(push)
# pragma warning (disable: 4100) // unreferenced formal parameter
#endif
namespace boost { namespace fusion
{
namespace detail
{
template <typename Seq1, typename Seq2>
struct sequence_copy
{
typedef typename result_of::end<Seq1>::type end1_type;
typedef typename result_of::end<Seq2>::type end2_type;
template <typename I1, typename I2>
static void
call(I1 const&, I2 const&, mpl::true_)
{
}
template <typename I1, typename I2>
static void
call(I1 const& src, I2 const& dest, mpl::false_)
{
*dest = *src;
call(fusion::next(src), fusion::next(dest));
}
template <typename I1, typename I2>
static void
call(I1 const& src, I2 const& dest)
{
typename result_of::equal_to<I1, end1_type>::type eq;
return call(src, dest, eq);
}
};
}
template <typename Seq1, typename Seq2>
inline void
copy(Seq1 const& src, Seq2& dest)
{
BOOST_STATIC_ASSERT(
result_of::size<Seq1>::value == result_of::size<Seq2>::value);
detail::sequence_copy<
Seq1 const, Seq2>::
call(fusion::begin(src), fusion::begin(dest));
}
}}
#if defined (BOOST_MSVC)
# pragma warning(pop)
#endif
#endif

View File

@@ -0,0 +1,17 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_ALGORITHM_ITERATION_10022005_0549)
#define FUSION_ALGORITHM_ITERATION_10022005_0549
#include <boost/fusion/algorithm/iteration/accumulate.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
#include <boost/fusion/algorithm/iteration/for_each.hpp>
#include <boost/fusion/algorithm/iteration/iter_fold.hpp>
#include <boost/fusion/algorithm/iteration/reverse_fold.hpp>
#include <boost/fusion/algorithm/iteration/reverse_iter_fold.hpp>
#endif

View File

@@ -0,0 +1,41 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_ACCUMULATE_09172005_1032)
#define FUSION_ACCUMULATE_09172005_1032
#include <boost/fusion/algorithm/iteration/accumulate_fwd.hpp>
#include <boost/fusion/algorithm/iteration/fold.hpp>
namespace boost { namespace fusion
{
struct void_;
namespace result_of
{
template <typename Sequence, typename State, typename F>
struct accumulate
: result_of::fold<Sequence, State, F>
{};
}
template <typename Sequence, typename State, typename F>
inline typename result_of::accumulate<Sequence, State const, F>::type
accumulate(Sequence& seq, State const& state, F f)
{
return fusion::fold(seq, state, f);
}
template <typename Sequence, typename State, typename F>
inline typename result_of::accumulate<Sequence const, State const, F>::type
accumulate(Sequence const& seq, State const& state, F f)
{
return fusion::fold(seq, state, f);
}
}}
#endif

View File

@@ -0,0 +1,28 @@
/*=============================================================================
Copyright (c) 2011 Eric Niebler
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_ACCUMULATE_FWD_HPP_INCLUDED)
#define BOOST_FUSION_ACCUMULATE_FWD_HPP_INCLUDED
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, typename State, typename F>
struct accumulate;
}
template <typename Sequence, typename State, typename F>
typename result_of::accumulate<Sequence, State const, F>::type
accumulate(Sequence& seq, State const& state, F f);
template <typename Sequence, typename State, typename F>
typename result_of::accumulate<Sequence const, State const, F>::type
accumulate(Sequence const& seq, State const& state, F f);
}}
#endif

View File

@@ -0,0 +1,462 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2006 Dan Marsden
Copyright (c) 2009-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)
==============================================================================*/
#include <boost/preprocessor/cat.hpp>
#ifdef BOOST_FUSION_REVERSE_FOLD
# ifdef BOOST_FUSION_ITER_FOLD
# define BOOST_FUSION_FOLD_NAME reverse_iter_fold
# else
# define BOOST_FUSION_FOLD_NAME reverse_fold
# endif
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION end
# define BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION prior
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(IT) \
typename fusion::result_of::prior<IT>::type
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(IT) fusion::prior(IT)
#else
# ifdef BOOST_FUSION_ITER_FOLD
# define BOOST_FUSION_FOLD_NAME iter_fold
# else
# define BOOST_FUSION_FOLD_NAME fold
# endif
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION begin
# define BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION next
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(IT) IT
# define BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(IT) IT
#endif
#ifdef BOOST_FUSION_ITER_FOLD
# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(IT) IT&
# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(IT) IT
#else
# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(IT) \
typename fusion::result_of::deref<IT>::type
# define BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(IT) fusion::deref(IT)
#endif
namespace boost { namespace fusion
{
namespace detail
{
template<typename State, typename It, typename F>
struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)
: boost::result_of<
F(
typename add_reference<typename add_const<State>::type>::type,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(It))
>
{};
template<typename Result,int N>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
It1;
It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0);
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It1
>::type
It2;
It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1);
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It2
>::type
It3;
It3 it3 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it2);
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State,It0,F>::type State1;
State1 const state1=f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0));
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State1,It1,F>::type State2;
State2 const state2=f(state1,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1));
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State2,It2,F>::type State3;
State3 const state3=f(state2,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it2));
return BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<
Result
, N-4
>::call(
f(state3,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it3)),
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it3),
f);
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,3>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
It1;
It1 it1 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0);
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It1
>::type
It2;
It2 it2 = fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it1);
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State,It0,F>::type State1;
State1 const state1=f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0));
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State1,It1,F>::type State2;
State2 const state2=f(state1,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it1));
return f(state2,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it2));
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,2>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<State,It0,F>::type State1;
State1 const state1=f(state,BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0));
return f(
state1,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(
fusion::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION(it0)));
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,1>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
return f(state,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM(it0));
}
};
template<typename Result>
struct BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<Result,0>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0, F)
{
return static_cast<Result>(state);
}
};
template<typename StateRef, typename It0, typename F, int N>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)
{
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
it1;
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<
rest1
, it1
, F
>::type
rest2;
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<it1>::type
it2;
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<
rest2
, it2
, F
>::type
rest3;
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<it2>::type
it3;
typedef typename
BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
typename BOOST_PP_CAT(
BOOST_FUSION_FOLD_NAME, _lvalue_state)<
rest3
, it3
, F
>::type
, typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
it3
>::type
, F
, N-4
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
StateRef
, It0
, F
, 3
>
{
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
it1;
typedef typename
BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<
typename BOOST_PP_CAT(
BOOST_FUSION_FOLD_NAME, _lvalue_state)<
rest1
, it1
, F
>::type
, typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
it1 const
>::type const
, F
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
StateRef
, It0
, F
, 2
>
: BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<
typename BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<
StateRef
, It0 const
, F
>::type
, typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
StateRef
, It0
, F
, 1
>
: BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME, _lvalue_state)<
StateRef
, It0 const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
StateRef
, It0
, F
, 0
>
{
typedef StateRef type;
};
template<typename StateRef, typename It0, typename F, int SeqSize>
struct BOOST_PP_CAT(result_of_first_unrolled,BOOST_FUSION_FOLD_NAME)
{
typedef typename
BOOST_PP_CAT(result_of_unrolled_,BOOST_FUSION_FOLD_NAME)<
typename boost::result_of<
F(
StateRef,
BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM(
It0 const)
)
>::type
, typename result_of::BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION<
It0 const
>::type
, F
, SeqSize-1
>::type
type;
};
template<int SeqSize, typename StateRef, typename Seq, typename F>
struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)
{
typedef typename
BOOST_PP_CAT(
result_of_first_unrolled,BOOST_FUSION_FOLD_NAME)<
StateRef
, BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM(
typename result_of::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION<Seq>::type
)
, F
, SeqSize
>::type
type;
static type
call(StateRef state, Seq& seq, F f)
{
typedef
BOOST_PP_CAT(unrolled_,BOOST_FUSION_FOLD_NAME)<
type
, SeqSize
>
unrolled_impl;
return unrolled_impl::call(
state,
BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM(
fusion::BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION(seq)),
f);
}
};
template<typename StateRef, typename Seq, typename F>
struct BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<0,StateRef,Seq,F>
{
typedef StateRef type;
static StateRef
call(StateRef state, Seq&, F)
{
return static_cast<StateRef>(state);
}
};
template<typename Seq, typename State, typename F, bool IsSegmented>
struct BOOST_PP_CAT(result_of_, BOOST_FUSION_FOLD_NAME)
: BOOST_PP_CAT(BOOST_FUSION_FOLD_NAME,_impl)<
result_of::size<Seq>::value
, typename add_reference<
typename add_const<State>::type
>::type
, Seq
, F
>
{};
}
namespace result_of
{
template<typename Seq, typename State, typename F>
struct BOOST_FUSION_FOLD_NAME
: detail::BOOST_PP_CAT(result_of_, BOOST_FUSION_FOLD_NAME)<
Seq
, State
, F
, traits::is_segmented<Seq>::type::value
>
{};
}
template<typename Seq, typename State, typename F>
inline typename result_of::BOOST_FUSION_FOLD_NAME<
Seq
, State const
, F
>::type
BOOST_FUSION_FOLD_NAME(Seq& seq, State const& state, F f)
{
return result_of::BOOST_FUSION_FOLD_NAME<Seq,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::BOOST_FUSION_FOLD_NAME<
Seq const
, State const
, F
>::type
BOOST_FUSION_FOLD_NAME(Seq const& seq, State const& state, F f)
{
return result_of::BOOST_FUSION_FOLD_NAME<Seq const,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::BOOST_FUSION_FOLD_NAME<
Seq
, State const
, F
>::type
BOOST_FUSION_FOLD_NAME(Seq& seq, State& state, F f)
{
return result_of::BOOST_FUSION_FOLD_NAME<Seq,State,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::BOOST_FUSION_FOLD_NAME<
Seq const
, State const
, F
>::type
BOOST_FUSION_FOLD_NAME(Seq const& seq, State& state, F f)
{
return result_of::BOOST_FUSION_FOLD_NAME<Seq const,State,F>::call(
state,
seq,
f);
}
}}
#undef BOOST_FUSION_FOLD_NAME
#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_FUNCTION
#undef BOOST_FUSION_FOLD_IMPL_NEXT_IT_FUNCTION
#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_META_TRANSFORM
#undef BOOST_FUSION_FOLD_IMPL_FIRST_IT_TRANSFORM
#undef BOOST_FUSION_FOLD_IMPL_INVOKE_IT_META_TRANSFORM
#undef BOOST_FUSION_FOLD_IMPL_INVOKE_IT_TRANSFORM

View File

@@ -0,0 +1,138 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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(FUSION_FOR_EACH_05052005_1028)
#define FUSION_FOR_EACH_05052005_1028
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/distance.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/mpl/bool.hpp>
namespace boost { namespace fusion {
namespace detail
{
template <typename First, typename Last, typename F>
inline void
for_each_linear(First const&, Last const&, F const&, mpl::true_)
{
}
template <typename First, typename Last, typename F>
inline void
for_each_linear(First const& first, Last const& last, F const& f, mpl::false_)
{
f(*first);
detail::for_each_linear(fusion::next(first), last, f,
result_of::equal_to<typename result_of::next<First>::type, Last>());
}
template <typename Sequence, typename F, typename Tag>
inline void
for_each_dispatch(Sequence& seq, F const& f, Tag)
{
detail::for_each_linear(
fusion::begin(seq)
, fusion::end(seq)
, f
, result_of::equal_to<
typename result_of::begin<Sequence>::type
, typename result_of::end<Sequence>::type>());
}
template<int N>
struct for_each_unrolled
{
template<typename I0, typename F>
static void call(I0 const& i0, F const& f)
{
f(*i0);
typedef typename result_of::next<I0>::type I1;
I1 i1(fusion::next(i0));
f(*i1);
typedef typename result_of::next<I1>::type I2;
I2 i2(fusion::next(i1));
f(*i2);
typedef typename result_of::next<I2>::type I3;
I3 i3(fusion::next(i2));
f(*i3);
for_each_unrolled<N-4>::call(fusion::next(i3), f);
}
};
template<>
struct for_each_unrolled<3>
{
template<typename I0, typename F>
static void call(I0 const& i0, F const& f)
{
f(*i0);
typedef typename result_of::next<I0>::type I1;
I1 i1(fusion::next(i0));
f(*i1);
typedef typename result_of::next<I1>::type I2;
I2 i2(fusion::next(i1));
f(*i2);
}
};
template<>
struct for_each_unrolled<2>
{
template<typename I0, typename F>
static void call(I0 const& i0, F const& f)
{
f(*i0);
typedef typename result_of::next<I0>::type I1;
I1 i1(fusion::next(i0));
f(*i1);
}
};
template<>
struct for_each_unrolled<1>
{
template<typename I0, typename F>
static void call(I0 const& i0, F const& f)
{
f(*i0);
}
};
template<>
struct for_each_unrolled<0>
{
template<typename It, typename F>
static void call(It const&, F const&)
{
}
};
template <typename Sequence, typename F>
inline void
for_each_dispatch(Sequence& seq, F const& f, random_access_traversal_tag)
{
typedef typename result_of::begin<Sequence>::type begin;
typedef typename result_of::end<Sequence>::type end;
for_each_unrolled<result_of::distance<begin, end>::type::value>::call(fusion::begin(seq), f);
}
template <typename Sequence, typename F>
inline void
for_each(Sequence& seq, F const& f, mpl::false_) // unsegmented implementation
{
detail::for_each_dispatch(seq, f, typename traits::category_of<Sequence>::type());
}
}}}
#endif

View File

@@ -0,0 +1,381 @@
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2007 Dan Marsden
Copyright (c) 2009-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)
This is an auto-generated file. Do not edit!
==============================================================================*/
namespace boost { namespace fusion
{
namespace detail
{
template<typename State, typename It, typename F>
struct fold_lvalue_state
: boost::result_of<
F(
typename add_reference<typename add_const<State>::type>::type,
typename fusion::result_of::deref<It>::type)
>
{};
template<typename Result,int N>
struct unrolled_fold
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename
result_of::next<
It2
>::type
It3;
It3 it3 = fusion::next(it2);
typedef typename fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
typedef typename fold_lvalue_state<State2,It2,F>::type State3;
State3 const state3=f(state2,fusion::deref(it2));
return unrolled_fold<
Result
, N-4
>::call(
f(state3,fusion::deref(it3)),
fusion::next(it3),
f);
}
};
template<typename Result>
struct unrolled_fold<Result,3>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename
result_of::next<
It0 const
>::type
It1;
It1 it1 = fusion::next(it0);
typedef typename
result_of::next<
It1
>::type
It2;
It2 it2 = fusion::next(it1);
typedef typename fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
typedef typename fold_lvalue_state<State1,It1,F>::type State2;
State2 const state2=f(state1,fusion::deref(it1));
return f(state2,fusion::deref(it2));
}
};
template<typename Result>
struct unrolled_fold<Result,2>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
typedef typename fold_lvalue_state<State,It0,F>::type State1;
State1 const state1=f(state,fusion::deref(it0));
return f(
state1,
fusion::deref( fusion::next(it0)));
}
};
template<typename Result>
struct unrolled_fold<Result,1>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0,F f)
{
return f(state,
fusion::deref(it0));
}
};
template<typename Result>
struct unrolled_fold<Result,0>
{
template<typename State, typename It0, typename F>
static Result
call(State const& state,It0 const& it0, F)
{
return static_cast<Result>(state);
}
};
template<typename StateRef, typename It0, typename F, int N>
struct result_of_unrolled_fold
{
typedef typename
fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::next<
It0 const
>::type
it1;
typedef typename
fold_lvalue_state<
rest1
, it1
, F
>::type
rest2;
typedef typename
result_of::next<it1>::type
it2;
typedef typename
fold_lvalue_state<
rest2
, it2
, F
>::type
rest3;
typedef typename
result_of::next<it2>::type
it3;
typedef typename
result_of_unrolled_fold<
typename fold_lvalue_state<
rest3
, it3
, F
>::type
, typename result_of::next<
it3
>::type
, F
, N-4
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_fold<
StateRef
, It0
, F
, 3
>
{
typedef typename
fold_lvalue_state<
StateRef
, It0 const
, F
>::type
rest1;
typedef typename
result_of::next<
It0 const
>::type
it1;
typedef typename
fold_lvalue_state<
typename fold_lvalue_state<
rest1
, it1
, F
>::type
, typename result_of::next<
it1 const
>::type const
, F
>::type
type;
};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_fold<
StateRef
, It0
, F
, 2
>
: fold_lvalue_state<
typename fold_lvalue_state<
StateRef
, It0 const
, F
>::type
, typename result_of::next<
It0 const
>::type const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_fold<
StateRef
, It0
, F
, 1
>
: fold_lvalue_state<
StateRef
, It0 const
, F
>
{};
template<typename StateRef, typename It0, typename F>
struct result_of_unrolled_fold<
StateRef
, It0
, F
, 0
>
{
typedef StateRef type;
};
template<typename StateRef, typename It0, typename F, int SeqSize>
struct result_of_first_unrolledfold
{
typedef typename
result_of_unrolled_fold<
typename boost::result_of<
F(
StateRef,
typename fusion::result_of::deref< It0 const>::type
)
>::type
, typename result_of::next<
It0 const
>::type
, F
, SeqSize-1
>::type
type;
};
template<int SeqSize, typename StateRef, typename Seq, typename F>
struct fold_impl
{
typedef typename
result_of_first_unrolledfold<
StateRef
, typename result_of::begin<Seq>::type
, F
, SeqSize
>::type
type;
static type
call(StateRef state, Seq& seq, F f)
{
typedef
unrolled_fold<
type
, SeqSize
>
unrolled_impl;
return unrolled_impl::call(
state,
fusion::begin(seq),
f);
}
};
template<typename StateRef, typename Seq, typename F>
struct fold_impl<0,StateRef,Seq,F>
{
typedef StateRef type;
static StateRef
call(StateRef state, Seq&, F)
{
return static_cast<StateRef>(state);
}
};
template<typename Seq, typename State, typename F, bool IsSegmented>
struct result_of_fold
: fold_impl<
result_of::size<Seq>::value
, typename add_reference<
typename add_const<State>::type
>::type
, Seq
, F
>
{};
}
namespace result_of
{
template<typename Seq, typename State, typename F>
struct fold
: detail::result_of_fold<
Seq
, State
, F
, traits::is_segmented<Seq>::type::value
>
{};
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<
Seq
, State const
, F
>::type
fold(Seq& seq, State const& state, F f)
{
return result_of::fold<Seq,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<
Seq const
, State const
, F
>::type
fold(Seq const& seq, State const& state, F f)
{
return result_of::fold<Seq const,State const,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<
Seq
, State const
, F
>::type
fold(Seq& seq, State& state, F f)
{
return result_of::fold<Seq,State,F>::call(
state,
seq,
f);
}
template<typename Seq, typename State, typename F>
inline typename result_of::fold<
Seq const
, State const
, F
>::type
fold(Seq const& seq, State& state, F f)
{
return result_of::fold<Seq const,State,F>::call(
state,
seq,
f);
}
}}

Some files were not shown because too many files have changed in this diff Show More