mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-29 12:07:36 +02:00
merge from trunk
[SVN r61043]
This commit is contained in:
@ -13,5 +13,6 @@
|
||||
#include <boost/fusion/adapted/array.hpp>
|
||||
#include <boost/fusion/adapted/mpl.hpp>
|
||||
#include <boost/fusion/adapted/struct.hpp>
|
||||
#include <boost/fusion/adapted/class.hpp>
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
@ -8,15 +9,19 @@
|
||||
#if !defined(BOOST_FUSION_ARRAY_27122005_1035)
|
||||
#define BOOST_FUSION_ARRAY_27122005_1035
|
||||
|
||||
#include <boost/fusion/adapted/array/array_iterator.hpp>
|
||||
//For backwards compatibility
|
||||
#include <boost/fusion/adapted/boost_array.hpp>
|
||||
|
||||
#include <boost/fusion/adapted/array/tag_of.hpp>
|
||||
#include <boost/fusion/adapted/array/detail/is_view_impl.hpp>
|
||||
#include <boost/fusion/adapted/array/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/adapted/array/detail/category_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/array/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/adapted/array/detail/end_impl.hpp>
|
||||
#include <boost/fusion/adapted/array/detail/size_impl.hpp>
|
||||
#include <boost/fusion/adapted/array/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/array/detail/value_at_impl.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
|
||||
|
38
include/boost/fusion/adapted/array/at_impl.hpp
Normal file
38
include/boost/fusion/adapted/array/at_impl.hpp
Normal 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
|
42
include/boost/fusion/adapted/array/begin_impl.hpp
Normal file
42
include/boost/fusion/adapted/array/begin_impl.hpp
Normal 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
|
32
include/boost/fusion/adapted/array/category_of_impl.hpp
Normal file
32
include/boost/fusion/adapted/array/category_of_impl.hpp
Normal 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
|
40
include/boost/fusion/adapted/array/deref_impl.hpp
Normal file
40
include/boost/fusion/adapted/array/deref_impl.hpp
Normal 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
|
44
include/boost/fusion/adapted/array/end_impl.hpp
Normal file
44
include/boost/fusion/adapted/array/end_impl.hpp
Normal 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
|
28
include/boost/fusion/adapted/array/is_sequence_impl.hpp
Normal file
28
include/boost/fusion/adapted/array/is_sequence_impl.hpp
Normal 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
|
28
include/boost/fusion/adapted/array/is_view_impl.hpp
Normal file
28
include/boost/fusion/adapted/array/is_view_impl.hpp
Normal 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
|
29
include/boost/fusion/adapted/array/size_impl.hpp
Normal file
29
include/boost/fusion/adapted/array/size_impl.hpp
Normal 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
|
@ -1,58 +1,72 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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(FUSION_SEQUENCE_TAG_OF_27122005_1030)
|
||||
#define FUSION_SEQUENCE_TAG_OF_27122005_1030
|
||||
|
||||
#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
|
||||
{
|
||||
template<typename T, std::size_t N>
|
||||
class array;
|
||||
}
|
||||
|
||||
namespace boost { namespace fusion
|
||||
namespace boost
|
||||
{
|
||||
struct array_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
namespace traits
|
||||
namespace fusion
|
||||
{
|
||||
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
|
||||
struct po_array_tag;
|
||||
struct po_array_iterator_tag;
|
||||
struct random_access_traversal_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
namespace traits
|
||||
{
|
||||
typedef array_tag type;
|
||||
#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;
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
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
|
||||
|
28
include/boost/fusion/adapted/array/value_at_impl.hpp
Normal file
28
include/boost/fusion/adapted/array/value_at_impl.hpp
Normal 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
|
28
include/boost/fusion/adapted/array/value_of_impl.hpp
Normal file
28
include/boost/fusion/adapted/array/value_of_impl.hpp
Normal 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
|
22
include/boost/fusion/adapted/boost_array.hpp
Normal file
22
include/boost/fusion/adapted/boost_array.hpp
Normal file
@ -0,0 +1,22 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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
|
@ -14,7 +14,7 @@
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct array_tag;
|
||||
struct boost_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -22,7 +22,7 @@ namespace boost { namespace fusion {
|
||||
struct at_impl;
|
||||
|
||||
template<>
|
||||
struct at_impl<array_tag>
|
||||
struct at_impl<boost_array_tag>
|
||||
{
|
||||
template<typename Sequence, typename N>
|
||||
struct apply
|
@ -8,11 +8,11 @@
|
||||
#if !defined(BOOST_FUSION_BEGIN_IMPL_27122005_1117)
|
||||
#define BOOST_FUSION_BEGIN_IMPL_27122005_1117
|
||||
|
||||
#include <boost/fusion/adapted/array/array_iterator.hpp>
|
||||
#include <boost/fusion/adapted/boost_array/array_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct array_tag;
|
||||
struct boost_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -20,7 +20,7 @@ namespace boost { namespace fusion {
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<array_tag>
|
||||
struct begin_impl<boost_array_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
@ -12,7 +12,7 @@
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct array_tag;
|
||||
struct boost_array_tag;
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
namespace extension
|
||||
@ -21,7 +21,7 @@ namespace boost { namespace fusion {
|
||||
struct category_of_impl;
|
||||
|
||||
template<>
|
||||
struct category_of_impl<array_tag>
|
||||
struct category_of_impl<boost_array_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply
|
@ -8,11 +8,11 @@
|
||||
#if !defined(BOOST_FUSION_END_IMPL_27122005_1120)
|
||||
#define BOOST_FUSION_END_IMPL_27122005_1120
|
||||
|
||||
#include <boost/fusion/adapted/array/array_iterator.hpp>
|
||||
#include <boost/fusion/adapted/boost_array/array_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct array_tag;
|
||||
struct boost_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -20,7 +20,7 @@ namespace boost { namespace fusion {
|
||||
struct end_impl;
|
||||
|
||||
template <>
|
||||
struct end_impl<array_tag>
|
||||
struct end_impl<boost_array_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
@ -12,7 +12,7 @@
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct array_tag;
|
||||
struct boost_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -20,7 +20,7 @@ namespace boost { namespace fusion {
|
||||
struct is_sequence_impl;
|
||||
|
||||
template<>
|
||||
struct is_sequence_impl<array_tag>
|
||||
struct is_sequence_impl<boost_array_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply : mpl::true_ {};
|
@ -12,7 +12,7 @@
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct array_tag;
|
||||
struct boost_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -20,7 +20,7 @@ namespace boost { namespace fusion
|
||||
struct is_view_impl;
|
||||
|
||||
template<>
|
||||
struct is_view_impl<array_tag>
|
||||
struct is_view_impl<boost_array_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply : mpl::false_
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct array_tag;
|
||||
struct boost_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -18,7 +18,7 @@ namespace boost { namespace fusion {
|
||||
struct size_impl;
|
||||
|
||||
template<>
|
||||
struct size_impl<array_tag>
|
||||
struct size_impl<boost_array_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply : mpl::int_<Sequence::static_size> {};
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct array_tag;
|
||||
struct boost_array_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -18,7 +18,7 @@ namespace boost { namespace fusion {
|
||||
struct value_at_impl;
|
||||
|
||||
template <>
|
||||
struct value_at_impl<array_tag>
|
||||
struct value_at_impl<boost_array_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
@ -5,24 +5,34 @@
|
||||
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_24122005_1722)
|
||||
#define BOOST_FUSION_TAG_OF_24122005_1722
|
||||
#if !defined(FUSION_SEQUENCE_TAG_OF_27122005_1030)
|
||||
#define FUSION_SEQUENCE_TAG_OF_27122005_1030
|
||||
|
||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||
|
||||
#include <boost/config/no_tr1/utility.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
namespace boost
|
||||
{
|
||||
template<typename T, std::size_t N>
|
||||
class array;
|
||||
}
|
||||
|
||||
struct std_pair_tag;
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct boost_array_tag;
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
namespace traits
|
||||
{
|
||||
template<typename T1, typename T2>
|
||||
struct tag_of<std::pair<T1, T2> >
|
||||
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 std_pair_tag type;
|
||||
typedef boost_array_tag type;
|
||||
};
|
||||
}
|
||||
}}
|
||||
@ -32,14 +42,14 @@ namespace boost { namespace mpl
|
||||
template<typename>
|
||||
struct sequence_tag;
|
||||
|
||||
template<typename T1, typename T2>
|
||||
struct sequence_tag<std::pair<T1, T2> >
|
||||
template<typename T, std::size_t N>
|
||||
struct sequence_tag<array<T,N> >
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
|
||||
template<typename T1, typename T2>
|
||||
struct sequence_tag<std::pair<T1, T2> const>
|
||||
template<typename T, std::size_t N>
|
||||
struct sequence_tag<array<T,N> const>
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
@ -1,28 +1,18 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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_CLASS_OCTOBER_4_2009_839PM)
|
||||
#define BOOST_FUSION_CLASS_OCTOBER_4_2009_839PM
|
||||
|
||||
#include <boost/fusion/adapted/class/extension.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_struct.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_struct.hpp>
|
||||
#include <boost/fusion/adapted/class/class_iterator.hpp>
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/at_key_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/category_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/end_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/has_key_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/is_view_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/size_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/value_at_key_impl.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class_named.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_class_named.hpp>
|
||||
#include <boost/fusion/adapted/class/adapt_class.hpp>
|
||||
|
||||
#endif
|
||||
|
76
include/boost/fusion/adapted/class/adapt_assoc_class.hpp
Normal file
76
include/boost/fusion/adapted/class/adapt_assoc_class.hpp
Normal file
@ -0,0 +1,76 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2007 Dan Marsden
|
||||
Copyright (c) 2010 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_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/class/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/adapt_base.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0(A, B, C, D, E)\
|
||||
((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1(A, B, C, D, E)\
|
||||
((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1_END
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_C( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_CLASS_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_CLASS( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(1)TEMPLATE_PARAMS_SEQ, \
|
||||
(1)NAME_SEQ, \
|
||||
assoc_struct_tag, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
assoc_struct_tag, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
|
||||
|
||||
#endif
|
@ -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_CLASS_ADAPT_ASSOC_CLASS_NAMED_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_NAMED_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS( \
|
||||
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE( \
|
||||
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_ASSOC_CLASS( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
|
||||
ATTRIBUTES)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS( \
|
||||
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
|
||||
|
||||
#endif
|
63
include/boost/fusion/adapted/class/adapt_class.hpp
Normal file
63
include/boost/fusion/adapted/class/adapt_class.hpp
Normal file
@ -0,0 +1,63 @@
|
||||
/*=============================================================================
|
||||
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_CLASS_ADAPT_CLASS_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_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/class/detail/extension.hpp>
|
||||
#include <boost/fusion/adapted/class/detail/adapt_base.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_FILLER_0(A, B, C, D)\
|
||||
((A, B, C, D)) BOOST_FUSION_ADAPT_CLASS_FILLER_1
|
||||
#define BOOST_FUSION_ADAPT_CLASS_FILLER_1(A, B, C, D)\
|
||||
((A, B, C, D)) BOOST_FUSION_ADAPT_CLASS_FILLER_0
|
||||
#define BOOST_FUSION_ADAPT_CLASS_FILLER_0_END
|
||||
#define BOOST_FUSION_ADAPT_CLASS_FILLER_1_END
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
|
||||
BOOST_FUSION_ADAPT_CLASS_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 4)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_TPL_CLASS(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES)\
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(1)TEMPLATE_PARAMS_SEQ, \
|
||||
(1)NAME_SEQ, \
|
||||
struct_tag, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_CLASS_C)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_CLASS_C)
|
||||
|
||||
|
||||
#endif
|
30
include/boost/fusion/adapted/class/adapt_class_named.hpp
Normal file
30
include/boost/fusion/adapted/class/adapt_class_named.hpp
Normal 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_CLASS_ADAPT_CLASS_NAMED_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_NAMED_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_class.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_NAMED_NS( \
|
||||
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE( \
|
||||
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_CLASS( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
|
||||
ATTRIBUTES)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_CLASS_NAMED_NS( \
|
||||
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
|
||||
|
||||
#endif
|
@ -1,15 +1,15 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
Copyright (c) 2001-2009 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_STRUCT_ITERATOR_APRIL_2_2007_1008AM)
|
||||
#define FUSION_STRUCT_ITERATOR_APRIL_2_2007_1008AM
|
||||
#if !defined(FUSION_CLASS_ITERATOR_OCTOBER_4_2009_839M)
|
||||
#define FUSION_CLASS_ITERATOR_OCTOBER_4_2009_839M
|
||||
|
||||
#include <boost/fusion/iterator/iterator_facade.hpp>
|
||||
#include <boost/fusion/adapted/struct/extension.hpp>
|
||||
#include <boost/fusion/adapted/class/extension.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
@ -23,23 +23,23 @@ namespace boost { namespace fusion
|
||||
{
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
template <typename Struct, int N_>
|
||||
struct struct_iterator
|
||||
: iterator_facade<struct_iterator<Struct, N_>, random_access_traversal_tag>
|
||||
template <typename Class, int N_>
|
||||
struct class_iterator
|
||||
: iterator_facade<class_iterator<Class, N_>, random_access_traversal_tag>
|
||||
{
|
||||
BOOST_MPL_ASSERT_RELATION(N_, >=, 0);
|
||||
BOOST_MPL_ASSERT_RELATION(N_, <=, extension::struct_size<Struct>::value);
|
||||
BOOST_MPL_ASSERT_RELATION(N_, <=, extension::class_size<Class>::value);
|
||||
|
||||
typedef mpl::int_<N_> index;
|
||||
typedef Struct struct_type;
|
||||
typedef Class class_type;
|
||||
|
||||
struct_iterator(Struct& struct_)
|
||||
: struct_(struct_) {}
|
||||
Struct& struct_;
|
||||
class_iterator(Class& class_)
|
||||
: class_(class_) {}
|
||||
Class& class_;
|
||||
|
||||
template <typename Iterator>
|
||||
struct value_of
|
||||
: extension::struct_member<Struct, N_>
|
||||
: extension::class_member<Class, N_>
|
||||
{
|
||||
};
|
||||
|
||||
@ -47,16 +47,18 @@ namespace boost { namespace fusion
|
||||
struct deref
|
||||
{
|
||||
typedef typename
|
||||
add_reference<
|
||||
typename extension::struct_member<Struct, N_>::type
|
||||
mpl::if_<
|
||||
is_const<Class>
|
||||
, typename extension::class_member<Class, N_>::get_type
|
||||
, typename extension::class_member<Class, N_>::proxy
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Iterator const& iter)
|
||||
{
|
||||
return extension::struct_member<Struct, N_>::
|
||||
call(iter.struct_);
|
||||
return extension::class_member<Class, N_>::
|
||||
call(iter.class_);
|
||||
}
|
||||
};
|
||||
|
||||
@ -64,13 +66,13 @@ namespace boost { namespace fusion
|
||||
struct advance
|
||||
{
|
||||
typedef typename Iterator::index index;
|
||||
typedef typename Iterator::struct_type struct_type;
|
||||
typedef struct_iterator<struct_type, index::value + N::value> type;
|
||||
typedef typename Iterator::class_type class_type;
|
||||
typedef class_iterator<class_type, index::value + N::value> type;
|
||||
|
||||
static type
|
||||
call(Iterator const& iter)
|
||||
{
|
||||
return type(iter.struct_);
|
||||
return type(iter.class_);
|
||||
}
|
||||
};
|
||||
|
||||
@ -95,10 +97,6 @@ namespace boost { namespace fusion
|
||||
return type();
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
// silence MSVC warning C4512: assignment operator could not be generated
|
||||
struct_iterator& operator= (struct_iterator const&);
|
||||
};
|
||||
}}
|
||||
|
115
include/boost/fusion/adapted/class/detail/adapt_base.hpp
Normal file
115
include/boost/fusion/adapted/class/detail/adapt_base.hpp
Normal file
@ -0,0 +1,115 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
Copyright (c) 2010 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_DETAIL_ADAPT_BASE_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_DETAIL_ADAPT_BASE_HPP
|
||||
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
|
||||
//cschmidt: Spirit relies on Fusion defining class_member_proxy in the
|
||||
//boost::fusion::extension namespace, with two nested types named lvalue and
|
||||
//rvalue.
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ)\
|
||||
typename detail::get_identity< \
|
||||
lvalue \
|
||||
, BOOST_PP_SEQ_ELEM(1,TEMPLATE_PARAMS_SEQ) \
|
||||
>::type
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_NON_TEMPLATE_IMPL( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
\
|
||||
lvalue
|
||||
|
||||
#define BOOST_FUSION_ADAPT_CLASS_C_BASE(\
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct class_member_proxy< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) rvalue; \
|
||||
\
|
||||
class_member_proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj)\
|
||||
: obj(obj) \
|
||||
{} \
|
||||
\
|
||||
template<class Arg> \
|
||||
class_member_proxy& \
|
||||
operator=(Arg const& val) \
|
||||
{ \
|
||||
BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \
|
||||
return *this; \
|
||||
} \
|
||||
\
|
||||
operator lvalue() \
|
||||
{ \
|
||||
return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
|
||||
} \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
|
||||
}; \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct struct_member<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \
|
||||
\
|
||||
typedef \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), \
|
||||
BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_TEMPLATE_IMPL, \
|
||||
BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_NON_TEMPLATE_IMPL)( \
|
||||
TEMPLATE_PARAMS_SEQ) \
|
||||
type; \
|
||||
\
|
||||
template<typename Seq> \
|
||||
struct apply \
|
||||
{ \
|
||||
typedef \
|
||||
class_member_proxy< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
|
||||
, I \
|
||||
> \
|
||||
proxy; \
|
||||
\
|
||||
typedef typename \
|
||||
mpl::if_< \
|
||||
is_const<Seq> \
|
||||
, BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
|
||||
, proxy \
|
||||
>::type \
|
||||
type; \
|
||||
\
|
||||
static proxy \
|
||||
call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \
|
||||
{ \
|
||||
return proxy(obj); \
|
||||
} \
|
||||
\
|
||||
static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
|
||||
call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \
|
||||
{ \
|
||||
return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
|
||||
} \
|
||||
}; \
|
||||
};
|
||||
|
||||
#endif
|
70
include/boost/fusion/adapted/class/detail/at_impl.hpp
Normal file
70
include/boost/fusion/adapted/class/detail/at_impl.hpp
Normal file
@ -0,0 +1,70 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2009 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_OCTOBER_4_2009_920PM)
|
||||
#define BOOST_FUSION_AT_IMPL_OCTOBER_4_2009_920PM
|
||||
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct at_impl;
|
||||
|
||||
template <typename Class, int N>
|
||||
struct class_member;
|
||||
|
||||
template <typename Class>
|
||||
struct class_size;
|
||||
|
||||
template <>
|
||||
struct at_impl<class_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
static int const n_value = N::value;
|
||||
BOOST_MPL_ASSERT_RELATION(
|
||||
n_value, <=, extension::class_size<Sequence>::value);
|
||||
|
||||
typedef typename
|
||||
extension::class_member<Sequence, N::value>
|
||||
element;
|
||||
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
is_const<Sequence>
|
||||
, typename class_member<Sequence, N::value>::get_type
|
||||
, typename class_member<Sequence, N::value>::proxy
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Sequence& seq)
|
||||
{
|
||||
return extension::
|
||||
class_member<Sequence, N::value>::call(seq);
|
||||
}
|
||||
|
||||
//~ static typename class_member<Sequence, N::value>::get_type
|
||||
//~ call(Sequence const& seq)
|
||||
//~ {
|
||||
//~ return extension::
|
||||
//~ class_member<Sequence, N::value>::call(seq);
|
||||
//~ }
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,35 +1,35 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2007 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_KEY_IMPL_20070508_2248)
|
||||
#define BOOST_FUSION_AT_KEY_IMPL_20070508_2248
|
||||
#if !defined(BOOST_FUSION_AT_KEY_IMPL_OCTOBER_4_2009_920PM)
|
||||
#define BOOST_FUSION_AT_KEY_IMPL_OCTOBER_4_2009_920PM
|
||||
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct struct_tag;
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct at_key_impl;
|
||||
|
||||
template <typename Struct, typename Key>
|
||||
struct struct_assoc_member;
|
||||
template <typename Class, typename Key>
|
||||
struct class_assoc_member;
|
||||
|
||||
template <>
|
||||
struct at_key_impl<struct_tag>
|
||||
struct at_key_impl<class_tag>
|
||||
{
|
||||
template <typename Sequence, typename Key>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
extension::struct_assoc_member<Sequence, Key>
|
||||
extension::class_assoc_member<Sequence, Key>
|
||||
element;
|
||||
|
||||
typedef typename
|
||||
@ -44,7 +44,7 @@ namespace boost { namespace fusion
|
||||
call(Sequence& seq)
|
||||
{
|
||||
return extension::
|
||||
struct_assoc_member<Sequence, Key>::call(seq);
|
||||
class_assoc_member<Sequence, Key>::call(seq);
|
||||
}
|
||||
};
|
||||
};
|
@ -1,18 +1,18 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_BEGIN_IMPL_24122005_1752)
|
||||
#define BOOST_FUSION_BEGIN_IMPL_24122005_1752
|
||||
#if !defined(BOOST_FUSION_BEGIN_IMPL_OCTOBER_4_2009_920PM)
|
||||
#define BOOST_FUSION_BEGIN_IMPL_OCTOBER_4_2009_920PM
|
||||
|
||||
#include <boost/fusion/adapted/std_pair/std_pair_iterator.hpp>
|
||||
#include <boost/fusion/adapted/class/class_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_pair_tag;
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -20,13 +20,13 @@ namespace boost { namespace fusion {
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<std_pair_tag>
|
||||
struct begin_impl<class_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
struct apply
|
||||
{
|
||||
typedef std_pair_iterator<Sequence, 0> type;
|
||||
|
||||
typedef class_iterator<Sequence, 0> type;
|
||||
|
||||
static type
|
||||
call(Sequence& v)
|
||||
{
|
@ -1,18 +1,18 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731)
|
||||
#define BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731
|
||||
#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_OCTOBER_4_2009_919PM)
|
||||
#define BOOST_FUSION_CATEGORY_OF_IMPL_OCTOBER_4_2009_919PM
|
||||
|
||||
#include <boost/config/no_tr1/utility.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_pair_tag;
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct class_tag;
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
namespace extension
|
||||
@ -21,7 +21,7 @@ namespace boost { namespace fusion {
|
||||
struct category_of_impl;
|
||||
|
||||
template<>
|
||||
struct category_of_impl<std_pair_tag>
|
||||
struct category_of_impl<class_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply
|
@ -1,32 +1,40 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_END_IMPL_24122005_1755)
|
||||
#define BOOST_FUSION_END_IMPL_24122005_1755
|
||||
#if !defined(BOOST_FUSION_END_IMPL_OCTOBER_4_2009_919PM)
|
||||
#define BOOST_FUSION_END_IMPL_OCTOBER_4_2009_919PM
|
||||
|
||||
#include <boost/fusion/adapted/std_pair/std_pair_iterator.hpp>
|
||||
#include <boost/fusion/adapted/class/class_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_pair_tag;
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <typename Class>
|
||||
struct class_size;
|
||||
|
||||
template <>
|
||||
struct end_impl<std_pair_tag>
|
||||
struct end_impl<class_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
struct apply
|
||||
{
|
||||
typedef std_pair_iterator<Sequence, 2> type;
|
||||
|
||||
typedef
|
||||
class_iterator<
|
||||
Sequence
|
||||
, class_size<Sequence>::value
|
||||
>
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Sequence& v)
|
||||
{
|
33
include/boost/fusion/adapted/class/detail/extension.hpp
Normal file
33
include/boost/fusion/adapted/class/detail/extension.hpp
Normal file
@ -0,0 +1,33 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
Copyright (c) 2010 Christopher Schmidt
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_CLASS_DETAIL_EXTENSION_HPP
|
||||
#define BOOST_FUSION_ADAPTED_CLASS_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>
|
||||
{};
|
||||
}
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename T, int N>
|
||||
struct class_member_proxy;
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,19 +1,19 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2007 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_20070508_2231)
|
||||
#define BOOST_FUSION_HAS_KEY_IMPL_20070508_2231
|
||||
#if !defined(BOOST_FUSION_HAS_KEY_IMPL_OCTOBER_4_2009_919PM)
|
||||
#define BOOST_FUSION_HAS_KEY_IMPL_OCTOBER_4_2009_919PM
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct struct_tag;
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -22,15 +22,15 @@ namespace boost { namespace fusion {
|
||||
template<typename T>
|
||||
struct has_key_impl;
|
||||
|
||||
template<typename Struct, typename Key>
|
||||
struct struct_assoc_member;
|
||||
template<typename Class, typename Key>
|
||||
struct class_assoc_member;
|
||||
|
||||
template<>
|
||||
struct has_key_impl<struct_tag>
|
||||
struct has_key_impl<class_tag>
|
||||
{
|
||||
template<typename Sequence, typename Key>
|
||||
struct apply
|
||||
: mpl::not_<is_same<no_such_member, typename struct_assoc_member<Sequence, Key>::type> >
|
||||
: mpl::not_<is_same<no_such_member, typename class_assoc_member<Sequence, Key>::type> >
|
||||
{
|
||||
};
|
||||
};
|
@ -1,18 +1,18 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651)
|
||||
#define BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651
|
||||
#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_OCTOBER_4_2009_919PM)
|
||||
#define BOOST_FUSION_IS_SEQUENCE_IMPL_OCTOBER_4_2009_919PM
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_pair_tag;
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -20,7 +20,7 @@ namespace boost { namespace fusion {
|
||||
struct is_sequence_impl;
|
||||
|
||||
template<>
|
||||
struct is_sequence_impl<std_pair_tag>
|
||||
struct is_sequence_impl<class_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply : mpl::true_ {};
|
@ -1,18 +1,18 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_IS_VIEW_IMPL_27042006_2219)
|
||||
#define BOOST_FUSION_IS_VIEW_IMPL_27042006_2219
|
||||
#if !defined(BOOST_FUSION_IS_VIEW_IMPL_OCTOBER_4_2009_919PM)
|
||||
#define BOOST_FUSION_IS_VIEW_IMPL_OCTOBER_4_2009_919PM
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct std_pair_tag;
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -20,7 +20,7 @@ namespace boost { namespace fusion
|
||||
struct is_view_impl;
|
||||
|
||||
template<>
|
||||
struct is_view_impl<std_pair_tag>
|
||||
struct is_view_impl<class_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply : mpl::false_
|
@ -1,18 +1,24 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SIZE_IMPL_24122005_1759)
|
||||
#define BOOST_FUSION_SIZE_IMPL_24122005_1759
|
||||
#if !defined(BOOST_FUSION_SIZE_IMPL_OCTOBER_4_2009_919PM)
|
||||
#define BOOST_FUSION_SIZE_IMPL_OCTOBER_4_2009_919PM
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
namespace extension
|
||||
{
|
||||
template <typename Class>
|
||||
struct class_size;
|
||||
}
|
||||
|
||||
struct std_pair_tag;
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
@ -20,10 +26,10 @@ namespace boost { namespace fusion {
|
||||
struct size_impl;
|
||||
|
||||
template <>
|
||||
struct size_impl<std_pair_tag>
|
||||
struct size_impl<class_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply : mpl::int_<2> {};
|
||||
struct apply : extension::class_size<Sequence> {};
|
||||
};
|
||||
}
|
||||
}}
|
@ -1,39 +1,43 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_VALUE_AT_IMPL_24122005_1917)
|
||||
#define BOOST_FUSION_VALUE_AT_IMPL_24122005_1917
|
||||
#if !defined(BOOST_FUSION_VALUE_AT_IMPL_OCTOBER_4_2009_918PM)
|
||||
#define BOOST_FUSION_VALUE_AT_IMPL_OCTOBER_4_2009_918PM
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_pair_tag;
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct value_at_impl;
|
||||
|
||||
template <typename Class, int N>
|
||||
struct class_member;
|
||||
|
||||
template <typename Class>
|
||||
struct class_size;
|
||||
|
||||
template <>
|
||||
struct value_at_impl<std_pair_tag>
|
||||
struct value_at_impl<class_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
struct apply
|
||||
{
|
||||
static int const n_value = N::value;
|
||||
BOOST_STATIC_ASSERT((n_value >= 0 && n_value < 2));
|
||||
BOOST_MPL_ASSERT_RELATION(
|
||||
n_value, <=, extension::class_size<Sequence>::value);
|
||||
|
||||
typedef typename
|
||||
mpl::if_c<
|
||||
(n_value == 0)
|
||||
, typename Sequence::first_type
|
||||
, typename Sequence::second_type
|
||||
>::type
|
||||
extension::class_member<Sequence, N::value>::type
|
||||
type;
|
||||
};
|
||||
};
|
@ -1,35 +1,35 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
Copyright (c) 2001-2009 Joel de Guzman
|
||||
Copyright (c) 2005-2007 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_KEY_IMPL_20070508_2300)
|
||||
#define BOOST_FUSION_VALUE_AT_KEY_IMPL_20070508_2300
|
||||
#if !defined(BOOST_FUSION_VALUE_AT_KEY_IMPL_OCTOBER_4_2009_918PM)
|
||||
#define BOOST_FUSION_VALUE_AT_KEY_IMPL_OCTOBER_4_2009_918PM
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct struct_tag;
|
||||
struct class_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct value_at_key_impl;
|
||||
|
||||
template <typename Struct, typename Key>
|
||||
struct struct_assoc_member;
|
||||
template <typename Class, typename Key>
|
||||
struct class_assoc_member;
|
||||
|
||||
template <>
|
||||
struct value_at_key_impl<struct_tag>
|
||||
struct value_at_key_impl<class_tag>
|
||||
{
|
||||
template <typename Sequence, typename Key>
|
||||
struct apply
|
||||
{
|
||||
typedef typename
|
||||
extension::struct_assoc_member<Sequence, Key>::type
|
||||
extension::class_assoc_member<Sequence, Key>::type
|
||||
type;
|
||||
};
|
||||
};
|
68
include/boost/fusion/adapted/class/extension.hpp
Normal file
68
include/boost/fusion/adapted/class/extension.hpp
Normal file
@ -0,0 +1,68 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2009 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_CLASS_EXTENSION_OCTOBER_4_2009_839PM)
|
||||
#define FUSION_CLASS_EXTENSION_OCTOBER_4_2009_839PM
|
||||
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename Class, int N>
|
||||
struct class_member;
|
||||
|
||||
template <typename Class>
|
||||
struct class_size;
|
||||
|
||||
template <typename Class, int N>
|
||||
struct class_member<Class const, N> : class_member<Class, N> {};
|
||||
//~ {
|
||||
//~ typedef typename class_member<Class, N>::type type;
|
||||
//~ typedef typename class_member<Class, N>::get_type get_type;
|
||||
//~ typedef typename class_member<Class, N>::proxy proxy;
|
||||
|
||||
//~ static get_type&
|
||||
//~ call(Class const& class_)
|
||||
//~ {
|
||||
//~ return class_member<Class, N>::call(
|
||||
//~ const_cast<Class&>(class_));
|
||||
//~ }
|
||||
//~ };
|
||||
|
||||
template <typename Class>
|
||||
struct class_size<Class const>
|
||||
: class_size<Class>
|
||||
{};
|
||||
|
||||
struct no_such_member;
|
||||
|
||||
template<typename Class, typename Key>
|
||||
struct class_assoc_member
|
||||
{
|
||||
typedef no_such_member type;
|
||||
};
|
||||
|
||||
template<typename Class, typename Key>
|
||||
struct class_assoc_member<Class const, Key>
|
||||
{
|
||||
typedef typename
|
||||
add_const<typename class_assoc_member<Class, Key>::type>::type
|
||||
type;
|
||||
|
||||
static type&
|
||||
call(Class const& class_)
|
||||
{
|
||||
return class_assoc_member<Class, Key>::call(
|
||||
const_cast<Class&>(class_));
|
||||
}
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,89 +1,24 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STD_PAIR_24122005_1744)
|
||||
#define BOOST_FUSION_STD_PAIR_24122005_1744
|
||||
|
||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||
#include <boost/fusion/adapted/struct.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/config/no_tr1/utility.hpp>
|
||||
#ifndef BOOST_FUSION_ADAPTED_STD_PAIR_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STD_PAIR_HPP
|
||||
|
||||
namespace boost { namespace fusion
|
||||
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
|
||||
|
||||
namespace std
|
||||
{
|
||||
struct struct_tag;
|
||||
struct fusion_sequence_tag;
|
||||
template<class T1, class T2>
|
||||
struct pair;
|
||||
}
|
||||
|
||||
namespace traits
|
||||
{
|
||||
template <typename T1, typename T2>
|
||||
#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
|
||||
struct tag_of<std::pair<T1, T2>, void >
|
||||
#else
|
||||
struct tag_of<std::pair<T1, T2> >
|
||||
#endif
|
||||
{
|
||||
typedef struct_tag type;
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
namespace boost { namespace mpl
|
||||
{
|
||||
template<typename>
|
||||
struct sequence_tag;
|
||||
|
||||
template<typename T1, typename T2>
|
||||
struct sequence_tag<std::pair<T1, T2> >
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
|
||||
template<typename T1, typename T2>
|
||||
struct sequence_tag<std::pair<T1, T2> const>
|
||||
{
|
||||
typedef fusion::fusion_sequence_tag type;
|
||||
};
|
||||
}}
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
template <typename Struct, int N>
|
||||
struct struct_member;
|
||||
|
||||
template <typename Struct>
|
||||
struct struct_size;
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct struct_member<std::pair<T1, T2>, 0>
|
||||
{
|
||||
typedef T1 type;
|
||||
|
||||
static type& call(std::pair<T1, T2>& pair)
|
||||
{
|
||||
return pair.first;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct struct_member<std::pair<T1, T2>, 1>
|
||||
{
|
||||
typedef T2 type;
|
||||
|
||||
static type& call(std::pair<T1, T2>& pair)
|
||||
{
|
||||
return pair.second;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct struct_size<std::pair<T1, T2> > : mpl::int_<2>
|
||||
{
|
||||
};
|
||||
}}}
|
||||
BOOST_FUSION_ADAPT_TPL_STRUCT(
|
||||
(T1)(T2),(std::pair)(T1)(T2),(T1, first)(T2, second))
|
||||
|
||||
#endif
|
||||
|
@ -1,71 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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_24122005_1807)
|
||||
#define BOOST_FUSION_AT_IMPL_24122005_1807
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct std_pair_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct at_impl;
|
||||
|
||||
template <>
|
||||
struct at_impl<std_pair_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
static int const n_value = N::value;
|
||||
BOOST_STATIC_ASSERT((n_value >= 0 && n_value < 2));
|
||||
typedef typename
|
||||
mpl::if_c<
|
||||
(n_value == 0)
|
||||
, typename Sequence::first_type
|
||||
, typename Sequence::second_type
|
||||
>
|
||||
element;
|
||||
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
is_const<Sequence>
|
||||
, detail::cref_result<element>
|
||||
, detail::ref_result<element>
|
||||
>::type
|
||||
type;
|
||||
|
||||
template <typename RT>
|
||||
static RT get(Sequence& p, mpl::int_<0>)
|
||||
{
|
||||
return p.first;
|
||||
}
|
||||
|
||||
template <typename RT>
|
||||
static RT get(Sequence& p, mpl::int_<1>)
|
||||
{
|
||||
return p.second;
|
||||
}
|
||||
|
||||
static type
|
||||
call(Sequence& p)
|
||||
{
|
||||
return get<type>(p, N());
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,127 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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_PAIR_ITERATOR_09262005_0934)
|
||||
#define FUSION_STD_PAIR_ITERATOR_09262005_0934
|
||||
|
||||
#include <boost/fusion/iterator/iterator_facade.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/minus.hpp>
|
||||
#include <boost/config/no_tr1/utility.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
template <typename Pair_, int N_>
|
||||
struct std_pair_iterator
|
||||
: iterator_facade<std_pair_iterator<Pair_, N_>, random_access_traversal_tag>
|
||||
{
|
||||
BOOST_MPL_ASSERT_RELATION(N_, >=, 0);
|
||||
BOOST_MPL_ASSERT_RELATION(N_, <=, 2);
|
||||
|
||||
typedef mpl::int_<N_> index;
|
||||
typedef Pair_ pair_type;
|
||||
|
||||
std_pair_iterator(Pair_& pair)
|
||||
: pair(pair) {}
|
||||
Pair_& pair;
|
||||
|
||||
template <typename Iterator>
|
||||
struct value_of;
|
||||
|
||||
template <typename Pair>
|
||||
struct value_of<std_pair_iterator<Pair, 0> >
|
||||
: mpl::identity<typename Pair::first_type> {};
|
||||
|
||||
template <typename Pair>
|
||||
struct value_of<std_pair_iterator<Pair, 1> >
|
||||
: mpl::identity<typename Pair::second_type> {};
|
||||
|
||||
template <typename Iterator>
|
||||
struct deref;
|
||||
|
||||
template <typename Pair>
|
||||
struct deref<std_pair_iterator<Pair, 0> >
|
||||
{
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
is_const<Pair>
|
||||
, typename Pair::first_type const&
|
||||
, typename Pair::first_type&
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(std_pair_iterator<Pair, 0> const& iter)
|
||||
{
|
||||
return iter.pair.first;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Pair>
|
||||
struct deref<std_pair_iterator<Pair, 1> >
|
||||
{
|
||||
typedef typename
|
||||
mpl::if_<
|
||||
is_const<Pair>
|
||||
, typename Pair::second_type const&
|
||||
, typename Pair::second_type&
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(std_pair_iterator<Pair, 1> const& iter)
|
||||
{
|
||||
return iter.pair.second;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Iterator, typename N>
|
||||
struct advance
|
||||
{
|
||||
typedef typename Iterator::index index;
|
||||
typedef typename Iterator::pair_type pair_type;
|
||||
typedef std_pair_iterator<pair_type, index::value + N::value> type;
|
||||
|
||||
static type
|
||||
call(Iterator const& iter)
|
||||
{
|
||||
return type(iter.pair);
|
||||
}
|
||||
};
|
||||
|
||||
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();
|
||||
}
|
||||
};
|
||||
};
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,28 +1,18 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_STRUCT_24122005_1744)
|
||||
#define BOOST_FUSION_STRUCT_24122005_1744
|
||||
|
||||
#include <boost/fusion/adapted/struct/extension.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
|
||||
#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/struct_iterator.hpp>
|
||||
|
||||
#include <boost/fusion/adapted/struct/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/at_key_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/begin_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/category_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/end_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/has_key_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_sequence_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/is_view_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/size_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_at_key_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_struct_named.hpp>
|
||||
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
|
||||
|
||||
#endif
|
||||
|
@ -1,113 +1,82 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_ADAPT_ASSOC_STRUCT_20070508_2207)
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_20070508_2207
|
||||
|
||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||
#include <boost/fusion/adapted/struct/extension.hpp>
|
||||
#include <boost/fusion/adapted/struct/struct_iterator.hpp>
|
||||
#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/size_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/has_key_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/at_key_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_at_key_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/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/seq/for_each_i.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/config/no_tr1/utility.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
|
||||
|
||||
namespace boost { namespace fusion { namespace extension {
|
||||
template<typename Struct, typename Key>
|
||||
struct struct_assoc_member;
|
||||
}}}
|
||||
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT(name, bseq) \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_I( \
|
||||
name, BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_X bseq, 0)) \
|
||||
/***/
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_X(x, y, z) ((x, y, z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_Y
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_Y(x, y, z) ((x, y, z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_X
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_X0
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_Y0
|
||||
|
||||
// BOOST_FUSION_ADAPT_ASSOC_STRUCT_I generates the overarching structure and uses
|
||||
// SEQ_FOR_EACH_I to generate the "linear" substructures.
|
||||
// Thanks to Paul Mensonides for the PP macro help
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_I(name, seq) \
|
||||
namespace boost { namespace fusion { namespace traits \
|
||||
{ \
|
||||
template <> \
|
||||
struct tag_of<name> \
|
||||
{ \
|
||||
typedef struct_tag type; \
|
||||
}; \
|
||||
}}} \
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE) \
|
||||
\
|
||||
namespace boost { namespace mpl \
|
||||
{ \
|
||||
template<typename> \
|
||||
struct sequence_tag; \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, PREFIX, ATTRIBUTE, 3) \
|
||||
\
|
||||
template<> \
|
||||
struct sequence_tag<name> \
|
||||
{ \
|
||||
typedef fusion::fusion_sequence_tag type; \
|
||||
}; \
|
||||
\
|
||||
template<> \
|
||||
struct sequence_tag<name const> \
|
||||
{ \
|
||||
typedef fusion::fusion_sequence_tag type; \
|
||||
}; \
|
||||
}} \
|
||||
\
|
||||
namespace boost { namespace fusion { namespace extension \
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct struct_assoc_key<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
|
||||
{ \
|
||||
template <> \
|
||||
struct struct_size<name> : mpl::int_<BOOST_PP_SEQ_SIZE(seq)> {}; \
|
||||
BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_ADAPT_ASSOC_STRUCT_C, name, seq) \
|
||||
}}} \
|
||||
/***/
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C(r, name, i, xy) \
|
||||
template <> \
|
||||
struct struct_member<name, i> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(3, 0, xy) type; \
|
||||
static type& call(name& struct_) \
|
||||
{ \
|
||||
return struct_.BOOST_PP_TUPLE_ELEM(3, 1, xy); \
|
||||
}; \
|
||||
}; \
|
||||
template<> \
|
||||
struct struct_assoc_member<name, BOOST_PP_TUPLE_ELEM(3, 2, xy)> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(3, 0, xy) type; \
|
||||
static type& call(name& struct_) \
|
||||
{ \
|
||||
return struct_.BOOST_PP_TUPLE_ELEM(3, 1, xy); \
|
||||
}; \
|
||||
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, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_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, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
|
||||
|
||||
#endif
|
||||
|
@ -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_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_C( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, obj., ATTRIBUTE)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \
|
||||
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE( \
|
||||
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \
|
||||
(0)NAMESPACE_SEQ)NAME), \
|
||||
assoc_struct_tag, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_C)
|
||||
|
||||
#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
|
@ -1,94 +1,59 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_ADAPT_STRUCT_APRIL_2_2007_1158AM)
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_APRIL_2_2007_1158AM
|
||||
|
||||
#include <boost/fusion/support/tag_of_fwd.hpp>
|
||||
#include <boost/fusion/adapted/struct/extension.hpp>
|
||||
#include <boost/fusion/adapted/struct/struct_iterator.hpp>
|
||||
#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/size_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_at_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/value_of_impl.hpp>
|
||||
#include <boost/fusion/adapted/struct/detail/deref_impl.hpp>
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/seq/for_each_i.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/config/no_tr1/utility.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(name, bseq) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_I( \
|
||||
name, BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_X bseq, 0)) \
|
||||
/***/
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\
|
||||
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY(),ATTRIBUTE,2)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_X(x, y) ((x, y)) BOOST_FUSION_ADAPT_STRUCT_Y
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_Y(x, y) ((x, y)) BOOST_FUSION_ADAPT_STRUCT_X
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_X0
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_Y0
|
||||
#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, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
// BOOST_FUSION_ADAPT_STRUCT_I generates the overarching structure and uses
|
||||
// SEQ_FOR_EACH_I to generate the "linear" substructures.
|
||||
// Thanks to Paul Mensonides for the PP macro help
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_I(name, seq) \
|
||||
namespace boost { namespace fusion { namespace traits \
|
||||
{ \
|
||||
template <> \
|
||||
struct tag_of<name> \
|
||||
{ \
|
||||
typedef struct_tag type; \
|
||||
}; \
|
||||
}}} \
|
||||
\
|
||||
namespace boost { namespace mpl \
|
||||
{ \
|
||||
template<typename> \
|
||||
struct sequence_tag; \
|
||||
\
|
||||
template<> \
|
||||
struct sequence_tag<name> \
|
||||
{ \
|
||||
typedef fusion::fusion_sequence_tag type; \
|
||||
}; \
|
||||
\
|
||||
template<> \
|
||||
struct sequence_tag<name const> \
|
||||
{ \
|
||||
typedef fusion::fusion_sequence_tag type; \
|
||||
}; \
|
||||
}} \
|
||||
\
|
||||
namespace boost { namespace fusion { namespace extension \
|
||||
{ \
|
||||
template <> \
|
||||
struct struct_size<name> : mpl::int_<BOOST_PP_SEQ_SIZE(seq)> {}; \
|
||||
BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_ADAPT_STRUCT_C, name, seq) \
|
||||
}}} \
|
||||
/***/
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_C(r, name, i, xy) \
|
||||
template <> \
|
||||
struct struct_member<name, i> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(2, 0, xy) type; \
|
||||
static type& call(name& struct_) \
|
||||
{ \
|
||||
return struct_.BOOST_PP_TUPLE_ELEM(2, 1, xy); \
|
||||
}; \
|
||||
}; \
|
||||
/***/
|
||||
#define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
struct_tag, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
#endif
|
||||
|
41
include/boost/fusion/adapted/struct/adapt_struct_named.hpp
Normal file
41
include/boost/fusion/adapted/struct/adapt_struct_named.hpp
Normal file
@ -0,0 +1,41 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 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_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_C( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, obj., ATTRIBUTE, 2)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
|
||||
WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE( \
|
||||
WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \
|
||||
(0)NAMESPACE_SEQ)NAME), \
|
||||
struct_tag, \
|
||||
BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED_C)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
|
||||
WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
|
||||
|
||||
#endif
|
41
include/boost/fusion/adapted/struct/define_assoc_struct.hpp
Normal file
41
include/boost/fusion/adapted/struct/define_assoc_struct.hpp
Normal file
@ -0,0 +1,41 @@
|
||||
/*=============================================================================
|
||||
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_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 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 ATTRIBUTES,_END), \
|
||||
3) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME, \
|
||||
ATTRIBUTES)
|
||||
|
||||
#endif
|
41
include/boost/fusion/adapted/struct/define_struct.hpp
Normal file
41
include/boost/fusion/adapted/struct/define_struct.hpp
Normal file
@ -0,0 +1,41 @@
|
||||
/*=============================================================================
|
||||
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_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 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 ATTRIBUTES,_END), \
|
||||
2) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME, \
|
||||
ATTRIBUTES)
|
||||
|
||||
#endif
|
203
include/boost/fusion/adapted/struct/detail/adapt_base.hpp
Normal file
203
include/boost/fusion/adapted/struct/detail/adapt_base.hpp
Normal file
@ -0,0 +1,203 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2009 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_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/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)
|
||||
|
||||
#define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
|
||||
TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
template< \
|
||||
BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
|
||||
> \
|
||||
struct struct_member<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
|
||||
{ \
|
||||
typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
|
||||
\
|
||||
template<typename Seq> \
|
||||
struct apply \
|
||||
{ \
|
||||
typedef typename \
|
||||
add_reference< \
|
||||
typename mpl::eval_if< \
|
||||
is_const<Seq> \
|
||||
, add_const<BOOST_PP_TUPLE_ELEM( \
|
||||
ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
|
||||
> \
|
||||
, mpl::identity<BOOST_PP_TUPLE_ELEM( \
|
||||
ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
|
||||
> \
|
||||
>::type \
|
||||
>::type \
|
||||
type; \
|
||||
\
|
||||
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,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_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \
|
||||
(ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ), \
|
||||
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_SEQ_SIZE(ATTRIBUTES_SEQ)> \
|
||||
{}; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
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
|
@ -1,63 +1,38 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_AT_IMPL_24122005_1807)
|
||||
#define BOOST_FUSION_AT_IMPL_24122005_1807
|
||||
|
||||
#include <boost/fusion/support/detail/access.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#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 boost { namespace fusion { namespace extension
|
||||
{
|
||||
struct struct_tag;
|
||||
template<typename>
|
||||
struct at_impl;
|
||||
|
||||
namespace extension
|
||||
template <>
|
||||
struct at_impl<struct_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct at_impl;
|
||||
template <typename Seq, typename N>
|
||||
struct apply
|
||||
: extension::struct_member<
|
||||
typename remove_const<Seq>::type
|
||||
, N::value
|
||||
>::template apply<Seq>
|
||||
{};
|
||||
};
|
||||
|
||||
template <typename Struct, int N>
|
||||
struct struct_member;
|
||||
|
||||
template <typename Struct>
|
||||
struct struct_size;
|
||||
|
||||
template <>
|
||||
struct at_impl<struct_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
static int const n_value = N::value;
|
||||
BOOST_MPL_ASSERT_RELATION(
|
||||
n_value, <=, extension::struct_size<Sequence>::value);
|
||||
|
||||
typedef typename
|
||||
extension::struct_member<Sequence, N::value>
|
||||
element;
|
||||
|
||||
typedef typename
|
||||
mpl::eval_if<
|
||||
is_const<Sequence>
|
||||
, detail::cref_result<element>
|
||||
, detail::ref_result<element>
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Sequence& seq)
|
||||
{
|
||||
return extension::
|
||||
struct_member<Sequence, N::value>::call(seq);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
template <>
|
||||
struct at_impl<assoc_struct_tag>
|
||||
: at_impl<struct_tag>
|
||||
{};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
@ -1,40 +1,67 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_BEGIN_IMPL_24122005_1752)
|
||||
#define BOOST_FUSION_BEGIN_IMPL_24122005_1752
|
||||
|
||||
#include <boost/fusion/adapted/struct/struct_iterator.hpp>
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_BEGIN_IMPL_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_BEGIN_IMPL_HPP
|
||||
|
||||
namespace boost { namespace fusion
|
||||
#include <boost/fusion/iterator/basic_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
struct struct_tag;
|
||||
template<typename>
|
||||
struct begin_impl;
|
||||
|
||||
namespace extension
|
||||
template <>
|
||||
struct begin_impl<struct_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct begin_impl;
|
||||
|
||||
template <>
|
||||
struct begin_impl<struct_tag>
|
||||
template <typename Seq>
|
||||
struct apply
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef struct_iterator<Sequence, 0> type;
|
||||
typedef
|
||||
basic_iterator<
|
||||
struct_iterator_tag
|
||||
, random_access_traversal_tag
|
||||
, Seq
|
||||
, 0
|
||||
>
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Sequence& v)
|
||||
{
|
||||
return type(v);
|
||||
}
|
||||
};
|
||||
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
|
||||
|
@ -1,34 +1,41 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731)
|
||||
#define BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731
|
||||
|
||||
#include <boost/config/no_tr1/utility.hpp>
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_CATEGORY_OF_IMPL_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_CATEGORY_OF_IMPL_HPP
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct struct_tag;
|
||||
struct random_access_traversal_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
template<typename>
|
||||
struct category_of_impl;
|
||||
|
||||
template<>
|
||||
struct category_of_impl<struct_tag>
|
||||
{
|
||||
template<typename T>
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
|
||||
|
308
include/boost/fusion/adapted/struct/detail/define_struct.hpp
Normal file
308
include/boost/fusion/adapted/struct/detail/define_struct.hpp
Normal file
@ -0,0 +1,308 @@
|
||||
/*=============================================================================
|
||||
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_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/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_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_EMPTY() \
|
||||
) \
|
||||
\
|
||||
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(ATTRIBUTES_SEQ) \
|
||||
BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
|
||||
BOOST_FUSION_DEFINE_STRUCT_CTOR_N, \
|
||||
BOOST_FUSION_DEFINE_STRUCT_CTOR_1)
|
||||
|
||||
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR(ATTRIBUTES_SEQ) \
|
||||
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)
|
||||
|
||||
#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_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_DEFINE_STRUCT_CTOR(ATTRIBUTES_SEQ)( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
|
||||
}; \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)
|
||||
|
||||
#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_FUSION_DEFINE_STRUCT_IMPL_IMPL( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR(ATTRIBUTES_SEQ)( \
|
||||
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
|
@ -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
|
41
include/boost/fusion/adapted/struct/detail/deref_impl.hpp
Normal file
41
include/boost/fusion/adapted/struct/detail/deref_impl.hpp
Normal 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
|
||||
extension::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
|
@ -1,48 +1,67 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_END_IMPL_24122005_1755)
|
||||
#define BOOST_FUSION_END_IMPL_24122005_1755
|
||||
|
||||
#include <boost/fusion/adapted/struct/struct_iterator.hpp>
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP
|
||||
|
||||
namespace boost { namespace fusion
|
||||
#include <boost/fusion/iterator/basic_iterator.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
struct struct_tag;
|
||||
template <typename>
|
||||
struct end_impl;
|
||||
|
||||
namespace extension
|
||||
template <>
|
||||
struct end_impl<struct_tag>
|
||||
{
|
||||
template <typename Tag>
|
||||
struct end_impl;
|
||||
|
||||
template <typename Struct>
|
||||
struct struct_size;
|
||||
|
||||
template <>
|
||||
struct end_impl<struct_tag>
|
||||
template <typename Seq>
|
||||
struct apply
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef
|
||||
struct_iterator<
|
||||
Sequence
|
||||
, struct_size<Sequence>::value
|
||||
>
|
||||
type;
|
||||
typedef
|
||||
basic_iterator<
|
||||
struct_iterator_tag
|
||||
, random_access_traversal_tag
|
||||
, Seq
|
||||
, struct_size<typename remove_const<Seq>::type>::value
|
||||
>
|
||||
type;
|
||||
|
||||
static type
|
||||
call(Sequence& v)
|
||||
{
|
||||
return type(v);
|
||||
}
|
||||
};
|
||||
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
|
||||
|
44
include/boost/fusion/adapted/struct/detail/extension.hpp
Normal file
44
include/boost/fusion/adapted/struct/detail/extension.hpp
Normal file
@ -0,0 +1,44 @@
|
||||
/*=============================================================================
|
||||
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
|
||||
: bidirectional_traversal_tag, associative_tag
|
||||
{};
|
||||
|
||||
namespace extension
|
||||
{
|
||||
struct no_such_member;
|
||||
|
||||
template<typename Seq, int N>
|
||||
struct struct_member;
|
||||
|
||||
template<typename Seq, int N>
|
||||
struct struct_member_name;
|
||||
|
||||
template<typename Seq, int N>
|
||||
struct struct_assoc_key;
|
||||
|
||||
template<typename Seq>
|
||||
struct struct_size;
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
@ -1,31 +1,35 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651)
|
||||
#define BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651
|
||||
|
||||
#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 boost { namespace fusion { namespace extension
|
||||
{
|
||||
struct struct_tag;
|
||||
template<typename>
|
||||
struct is_sequence_impl;
|
||||
|
||||
namespace extension
|
||||
template<>
|
||||
struct is_sequence_impl<struct_tag>
|
||||
{
|
||||
template<typename Tag>
|
||||
struct is_sequence_impl;
|
||||
template<typename Seq>
|
||||
struct apply
|
||||
: mpl::true_
|
||||
{};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct is_sequence_impl<struct_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply : mpl::true_ {};
|
||||
};
|
||||
}
|
||||
}}
|
||||
template <>
|
||||
struct is_sequence_impl<assoc_struct_tag>
|
||||
: is_sequence_impl<struct_tag>
|
||||
{};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
@ -1,32 +1,35 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_IS_VIEW_IMPL_27042006_2219)
|
||||
#define BOOST_FUSION_IS_VIEW_IMPL_27042006_2219
|
||||
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
struct struct_tag;
|
||||
template<typename>
|
||||
struct is_view_impl;
|
||||
|
||||
namespace extension
|
||||
template<>
|
||||
struct is_view_impl<struct_tag>
|
||||
{
|
||||
template<typename Tag>
|
||||
struct is_view_impl;
|
||||
template<typename Seq>
|
||||
struct apply
|
||||
: mpl::false_
|
||||
{};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct is_view_impl<struct_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct apply : mpl::false_
|
||||
{};
|
||||
};
|
||||
}
|
||||
}}
|
||||
template <>
|
||||
struct is_view_impl<assoc_struct_tag>
|
||||
: is_view_impl<struct_tag>
|
||||
{};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
29
include/boost/fusion/adapted/struct/detail/key_of_impl.hpp
Normal file
29
include/boost/fusion/adapted/struct/detail/key_of_impl.hpp
Normal 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
|
51
include/boost/fusion/adapted/struct/detail/namespace.hpp
Normal file
51
include/boost/fusion/adapted/struct/detail/namespace.hpp
Normal 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
|
30
include/boost/fusion/adapted/struct/detail/proxy_type.hpp
Normal file
30
include/boost/fusion/adapted/struct/detail/proxy_type.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
/*=============================================================================
|
||||
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( \
|
||||
WRAPPED_TYPE,NAMESPACE_SEQ,NAME) \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \
|
||||
\
|
||||
struct NAME \
|
||||
{ \
|
||||
NAME(WRAPPED_TYPE& obj) \
|
||||
: obj(obj) \
|
||||
{} \
|
||||
\
|
||||
WRAPPED_TYPE& obj; \
|
||||
}; \
|
||||
\
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ)
|
||||
|
||||
#endif
|
@ -1,37 +1,33 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_SIZE_IMPL_24122005_1759)
|
||||
#define BOOST_FUSION_SIZE_IMPL_24122005_1759
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_SIZE_IMPL_HPP
|
||||
#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_SIZE_IMPL_HPP
|
||||
|
||||
namespace boost { namespace fusion
|
||||
namespace boost { namespace fusion { namespace extension
|
||||
{
|
||||
namespace extension
|
||||
template<typename>
|
||||
struct size_impl;
|
||||
|
||||
template <>
|
||||
struct size_impl<struct_tag>
|
||||
{
|
||||
template <typename Struct>
|
||||
struct struct_size;
|
||||
}
|
||||
template <typename Seq>
|
||||
struct apply
|
||||
: struct_size<typename remove_const<Seq>::type>
|
||||
{};
|
||||
};
|
||||
|
||||
struct struct_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct size_impl;
|
||||
|
||||
template <>
|
||||
struct size_impl<struct_tag>
|
||||
{
|
||||
template <typename Sequence>
|
||||
struct apply : extension::struct_size<Sequence> {};
|
||||
};
|
||||
}
|
||||
}}
|
||||
template <>
|
||||
struct size_impl<assoc_struct_tag>
|
||||
: size_impl<struct_tag>
|
||||
{};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
@ -1,47 +1,33 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2006 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)
|
||||
==============================================================================*/
|
||||
#if !defined(BOOST_FUSION_VALUE_AT_IMPL_24122005_1917)
|
||||
#define BOOST_FUSION_VALUE_AT_IMPL_24122005_1917
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#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 boost { namespace fusion { namespace extension
|
||||
{
|
||||
struct struct_tag;
|
||||
template<typename>
|
||||
struct value_at_impl;
|
||||
|
||||
namespace extension
|
||||
template <>
|
||||
struct value_at_impl<struct_tag>
|
||||
{
|
||||
template<typename T>
|
||||
struct value_at_impl;
|
||||
template <typename Seq, typename N>
|
||||
struct apply
|
||||
: struct_member<typename remove_const<Seq>::type, N::value>
|
||||
{};
|
||||
};
|
||||
|
||||
template <typename Struct, int N>
|
||||
struct struct_member;
|
||||
|
||||
template <typename Struct>
|
||||
struct struct_size;
|
||||
|
||||
template <>
|
||||
struct value_at_impl<struct_tag>
|
||||
{
|
||||
template <typename Sequence, typename N>
|
||||
struct apply
|
||||
{
|
||||
static int const n_value = N::value;
|
||||
BOOST_MPL_ASSERT_RELATION(
|
||||
n_value, <=, extension::struct_size<Sequence>::value);
|
||||
|
||||
typedef typename
|
||||
extension::struct_member<Sequence, N::value>::type
|
||||
type;
|
||||
};
|
||||
};
|
||||
}
|
||||
}}
|
||||
template <>
|
||||
struct value_at_impl<assoc_struct_tag>
|
||||
: value_at_impl<struct_tag>
|
||||
{};
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
@ -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
|
29
include/boost/fusion/adapted/struct/detail/value_of_impl.hpp
Normal file
29
include/boost/fusion/adapted/struct/detail/value_of_impl.hpp
Normal 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
|
||||
: extension::struct_member<
|
||||
typename remove_const<typename It::seq_type>::type
|
||||
, It::index::value
|
||||
>
|
||||
{};
|
||||
};
|
||||
}}}
|
||||
|
||||
#endif
|
@ -1,73 +0,0 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 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_STRUCT_EXTENSION_APRIL_2_2007_1008AM)
|
||||
#define FUSION_STRUCT_EXTENSION_APRIL_2_2007_1008AM
|
||||
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
struct fusion_sequence_tag;
|
||||
|
||||
namespace extension
|
||||
{
|
||||
template <typename Struct, int N>
|
||||
struct struct_member;
|
||||
|
||||
template <typename Struct>
|
||||
struct struct_size;
|
||||
|
||||
template <typename Struct, int N>
|
||||
struct struct_member<Struct const, N>
|
||||
{
|
||||
typedef typename
|
||||
add_const<typename struct_member<Struct, N>::type>::type
|
||||
type;
|
||||
|
||||
static type&
|
||||
call(Struct const& struct_)
|
||||
{
|
||||
return struct_member<Struct, N>::call(
|
||||
const_cast<Struct&>(struct_));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Struct>
|
||||
struct struct_size<Struct const>
|
||||
: struct_size<Struct>
|
||||
{};
|
||||
|
||||
struct no_such_member;
|
||||
|
||||
template<typename Struct, typename Key>
|
||||
struct struct_assoc_member
|
||||
{
|
||||
typedef no_such_member type;
|
||||
};
|
||||
|
||||
template<typename Struct, typename Key>
|
||||
struct struct_assoc_member<Struct const, Key>
|
||||
{
|
||||
typedef typename
|
||||
add_const<typename struct_assoc_member<Struct, Key>::type>::type
|
||||
type;
|
||||
|
||||
static type&
|
||||
call(Struct const& struct_)
|
||||
{
|
||||
return struct_assoc_member<Struct, Key>::call(
|
||||
const_cast<Struct&>(struct_));
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}}
|
||||
|
||||
#endif
|
||||
|
||||
|
13
include/boost/fusion/include/adapt_assoc_class.hpp
Normal file
13
include/boost/fusion/include/adapt_assoc_class.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
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_INCLUDE_ADAPT_ASSOC_CLASS_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
|
||||
|
||||
#endif
|
13
include/boost/fusion/include/adapt_assoc_class_named.hpp
Normal file
13
include/boost/fusion/include/adapt_assoc_class_named.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
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_INCLUDE_ADAPT_ASSOC_CLASS_NAMED_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_NAMED_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_assoc_class_named.hpp>
|
||||
|
||||
#endif
|
13
include/boost/fusion/include/adapt_assoc_struct.hpp
Normal file
13
include/boost/fusion/include/adapt_assoc_struct.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
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_INCLUDE_ADAPT_ASSOC_STRUCT_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_STRUCT_HPP
|
||||
|
||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
|
||||
|
||||
#endif
|
13
include/boost/fusion/include/adapt_assoc_struct_named.hpp
Normal file
13
include/boost/fusion/include/adapt_assoc_struct_named.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
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_INCLUDE_ADAPT_ASSOC_STRUCT_NAMED_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_STRUCT_NAMED_HPP
|
||||
|
||||
#include <boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp>
|
||||
|
||||
#endif
|
13
include/boost/fusion/include/adapt_class.hpp
Normal file
13
include/boost/fusion/include/adapt_class.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 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)
|
||||
==============================================================================*/
|
||||
|
||||
#ifndef BOOST_FUSION_INCLUDE_ADAPT_CLASS_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_CLASS_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_class.hpp>
|
||||
|
||||
#endif
|
13
include/boost/fusion/include/adapt_class_named.hpp
Normal file
13
include/boost/fusion/include/adapt_class_named.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
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_INCLUDE_ADAPT_CLASS_NAMED_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_CLASS_NAMED_HPP
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_class_named.hpp>
|
||||
|
||||
#endif
|
@ -4,8 +4,9 @@
|
||||
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_INCLUDE_ADAPT_STRUCT)
|
||||
#define FUSION_INCLUDE_ADAPT_STRUCT
|
||||
|
||||
#ifndef BOOST_FUSION_INCLUDE_ADAPT_STRUCT_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_STRUCT_HPP
|
||||
|
||||
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
|
||||
|
||||
|
13
include/boost/fusion/include/adapt_struct_named.hpp
Normal file
13
include/boost/fusion/include/adapt_struct_named.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
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_INCLUDE_ADAPT_STRUCT_NAMED_HPP
|
||||
#define BOOST_FUSION_INCLUDE_ADAPT_STRUCT_NAMED_HPP
|
||||
|
||||
#include <boost/fusion/adapted/struct/adapt_struct_named.hpp>
|
||||
|
||||
#endif
|
12
include/boost/fusion/include/adapted_class_named.cpp
Normal file
12
include/boost/fusion/include/adapted_class_named.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2009 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_INCLUDE_ADAPT_CLASS_NAMED)
|
||||
#define FUSION_INCLUDE_ADAPT_CLASS_NAMED
|
||||
|
||||
#include <boost/fusion/adapted/class/adapt_class_named.hpp>
|
||||
|
||||
#endif
|
12
include/boost/fusion/include/boost_array.hpp
Normal file
12
include/boost/fusion/include/boost_array.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
/*=============================================================================
|
||||
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(FUSION_INCLUDE_BOOST_ARRAY)
|
||||
#define FUSION_INCLUDE_BOOST_ARRAY
|
||||
|
||||
#include <boost/fusion/adapted/boost_array.hpp>
|
||||
|
||||
#endif
|
13
include/boost/fusion/include/define_assoc_struct.hpp
Normal file
13
include/boost/fusion/include/define_assoc_struct.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
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_INCLUDE_DEFINE_ASSOC_STRUCT_HPP
|
||||
#define BOOST_FUSION_INCLUDE_DEFINE_ASSOC_STRUCT_HPP
|
||||
|
||||
#include <boost/fusion/adapted/struct/define_assoc_struct.hpp>
|
||||
|
||||
#endif
|
13
include/boost/fusion/include/define_struct.hpp
Normal file
13
include/boost/fusion/include/define_struct.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
/*=============================================================================
|
||||
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_INCLUDE_DEFINE_STRUCT_HPP
|
||||
#define BOOST_FUSION_INCLUDE_DEFINE_STRUCT_HPP
|
||||
|
||||
#include <boost/fusion/adapted/struct/define_struct.hpp>
|
||||
|
||||
#endif
|
@ -21,7 +21,7 @@ namespace boost { namespace fusion
|
||||
|
||||
// Special tags:
|
||||
struct iterator_facade_tag; // iterator facade tag
|
||||
struct array_iterator_tag; // boost::array iterator tag
|
||||
struct boost_array_iterator_tag; // boost::array iterator tag
|
||||
struct mpl_iterator_tag; // mpl sequence iterator tag
|
||||
struct std_pair_iterator_tag; // std::pair iterator tag
|
||||
|
||||
@ -51,7 +51,7 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
template <>
|
||||
struct advance_impl<array_iterator_tag>;
|
||||
struct advance_impl<boost_array_iterator_tag>;
|
||||
|
||||
template <>
|
||||
struct advance_impl<mpl_iterator_tag>;
|
||||
|
@ -95,11 +95,16 @@ namespace boost { namespace fusion
|
||||
|
||||
template <typename It1, typename It2>
|
||||
struct distance
|
||||
: mpl::minus<
|
||||
typename It2::index
|
||||
, typename It1::index
|
||||
>
|
||||
{};
|
||||
{
|
||||
typedef mpl::minus<typename It2::index, typename It1::index> type;
|
||||
|
||||
static
|
||||
type
|
||||
call(It1 const&, It2 const&)
|
||||
{
|
||||
return type();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename It1, typename It2>
|
||||
struct equal_to
|
||||
|
@ -14,7 +14,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
// Special tags:
|
||||
struct iterator_facade_tag; // iterator facade tag
|
||||
struct array_iterator_tag; // boost::array iterator tag
|
||||
struct boost_array_iterator_tag; // boost::array iterator tag
|
||||
struct mpl_iterator_tag; // mpl sequence iterator tag
|
||||
struct std_pair_iterator_tag; // std::pair iterator tag
|
||||
|
||||
@ -35,7 +35,7 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
template <>
|
||||
struct deref_impl<array_iterator_tag>;
|
||||
struct deref_impl<boost_array_iterator_tag>;
|
||||
|
||||
template <>
|
||||
struct deref_impl<mpl_iterator_tag>;
|
||||
|
@ -22,7 +22,7 @@ namespace boost { namespace fusion
|
||||
|
||||
// Special tags:
|
||||
struct iterator_facade_tag; // iterator facade tag
|
||||
struct array_iterator_tag; // boost::array iterator tag
|
||||
struct boost_array_iterator_tag; // boost::array iterator tag
|
||||
struct mpl_iterator_tag; // mpl sequence iterator tag
|
||||
struct std_pair_iterator_tag; // std::pair iterator tag
|
||||
|
||||
@ -48,7 +48,7 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
template <>
|
||||
struct distance_impl<array_iterator_tag>;
|
||||
struct distance_impl<boost_array_iterator_tag>;
|
||||
|
||||
template <>
|
||||
struct distance_impl<mpl_iterator_tag>;
|
||||
@ -61,8 +61,8 @@ namespace boost { namespace fusion
|
||||
{
|
||||
template <typename First, typename Last>
|
||||
struct distance
|
||||
: extension::distance_impl<typename detail::tag_of<First>::type>::
|
||||
template apply<First, Last>
|
||||
: extension::distance_impl<typename detail::tag_of<First>::type>::
|
||||
template apply<First, Last>
|
||||
{
|
||||
typedef typename extension::distance_impl<typename detail::tag_of<First>::type>::
|
||||
template apply<First, Last>::type distance_application;
|
||||
|
@ -18,7 +18,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
// Special tags:
|
||||
struct iterator_facade_tag; // iterator facade tag
|
||||
struct array_iterator_tag; // boost::array iterator tag
|
||||
struct boost_array_iterator_tag; // boost::array iterator tag
|
||||
struct mpl_iterator_tag; // mpl sequence iterator tag
|
||||
struct std_pair_iterator_tag; // std::pair iterator tag
|
||||
|
||||
@ -42,7 +42,7 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
template <>
|
||||
struct equal_to_impl<array_iterator_tag>;
|
||||
struct equal_to_impl<boost_array_iterator_tag>;
|
||||
|
||||
template <>
|
||||
struct equal_to_impl<mpl_iterator_tag>;
|
||||
|
@ -13,7 +13,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
// Special tags:
|
||||
struct iterator_facade_tag; // iterator facade tag
|
||||
struct array_iterator_tag; // boost::array iterator tag
|
||||
struct boost_array_iterator_tag; // boost::array iterator tag
|
||||
struct mpl_iterator_tag; // mpl sequence iterator tag
|
||||
struct std_pair_iterator_tag; // std::pair iterator tag
|
||||
|
||||
@ -34,7 +34,7 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
template <>
|
||||
struct next_impl<array_iterator_tag>;
|
||||
struct next_impl<boost_array_iterator_tag>;
|
||||
|
||||
template <>
|
||||
struct next_impl<mpl_iterator_tag>;
|
||||
|
@ -13,7 +13,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
// Special tags:
|
||||
struct iterator_facade_tag; // iterator facade tag
|
||||
struct array_iterator_tag; // boost::array iterator tag
|
||||
struct boost_array_iterator_tag; // boost::array iterator tag
|
||||
struct mpl_iterator_tag; // mpl sequence iterator tag
|
||||
struct std_pair_iterator_tag; // std::pair iterator tag
|
||||
|
||||
@ -34,7 +34,7 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
template <>
|
||||
struct prior_impl<array_iterator_tag>;
|
||||
struct prior_impl<boost_array_iterator_tag>;
|
||||
|
||||
template <>
|
||||
struct prior_impl<mpl_iterator_tag>;
|
||||
|
@ -14,7 +14,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
// Special tags:
|
||||
struct iterator_facade_tag; // iterator facade tag
|
||||
struct array_iterator_tag; // boost::array iterator tag
|
||||
struct boost_array_iterator_tag; // boost::array iterator tag
|
||||
struct mpl_iterator_tag; // mpl sequence iterator tag
|
||||
struct std_pair_iterator_tag; // std::pair iterator tag
|
||||
|
||||
@ -35,7 +35,7 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
template <>
|
||||
struct value_of_impl<array_iterator_tag>;
|
||||
struct value_of_impl<boost_array_iterator_tag>;
|
||||
|
||||
template <>
|
||||
struct value_of_impl<mpl_iterator_tag>;
|
||||
|
@ -32,9 +32,8 @@ namespace boost { namespace fusion { namespace detail
|
||||
static bool
|
||||
call(I1 const& a, I2 const& b, mpl::false_)
|
||||
{
|
||||
return *a > *b
|
||||
|| !(*b > *a)
|
||||
&& call(fusion::next(a), fusion::next(b));
|
||||
return *a > *b ||
|
||||
(!(*b > *a) && call(fusion::next(a), fusion::next(b)));
|
||||
}
|
||||
|
||||
template <typename I1, typename I2>
|
||||
|
@ -32,9 +32,8 @@ namespace boost { namespace fusion { namespace detail
|
||||
static bool
|
||||
call(I1 const& a, I2 const& b, mpl::false_)
|
||||
{
|
||||
return *a < *b
|
||||
|| !(*b < *a)
|
||||
&& call(fusion::next(a), fusion::next(b));
|
||||
return *a < *b ||
|
||||
(!(*b < *a) && call(fusion::next(a), fusion::next(b)));
|
||||
}
|
||||
|
||||
template <typename I1, typename I2>
|
||||
|
@ -17,7 +17,7 @@ namespace boost { namespace fusion
|
||||
// Special tags:
|
||||
struct sequence_facade_tag;
|
||||
struct boost_tuple_tag; // boost::tuples::tuple tag
|
||||
struct array_tag; // boost::array tag
|
||||
struct boost_array_tag; // boost::array tag
|
||||
struct mpl_sequence_tag; // mpl sequence tag
|
||||
struct std_pair_tag; // std::pair tag
|
||||
|
||||
@ -41,7 +41,7 @@ namespace boost { namespace fusion
|
||||
struct at_impl<boost_tuple_tag>;
|
||||
|
||||
template <>
|
||||
struct at_impl<array_tag>;
|
||||
struct at_impl<boost_array_tag>;
|
||||
|
||||
template <>
|
||||
struct at_impl<mpl_sequence_tag>;
|
||||
|
@ -18,7 +18,7 @@ namespace boost { namespace fusion
|
||||
{
|
||||
// Special tags:
|
||||
struct sequence_facade_tag;
|
||||
struct array_tag; // boost::array tag
|
||||
struct boost_array_tag; // boost::array tag
|
||||
struct mpl_sequence_tag; // mpl sequence tag
|
||||
struct std_pair_tag; // std::pair tag
|
||||
|
||||
@ -52,7 +52,7 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
template <>
|
||||
struct at_key_impl<array_tag>;
|
||||
struct at_key_impl<boost_array_tag>;
|
||||
|
||||
template <>
|
||||
struct at_key_impl<mpl_sequence_tag>;
|
||||
|
@ -14,7 +14,7 @@ namespace boost { namespace fusion
|
||||
// Special tags:
|
||||
struct sequence_facade_tag; // iterator facade tag
|
||||
struct boost_tuple_tag; // boost::tuples::tuple tag
|
||||
struct array_tag; // boost::array tag
|
||||
struct boost_array_tag; // boost::array tag
|
||||
struct mpl_sequence_tag; // mpl sequence tag
|
||||
struct std_pair_tag; // std::pair tag
|
||||
|
||||
@ -38,7 +38,7 @@ namespace boost { namespace fusion
|
||||
struct begin_impl<boost_tuple_tag>;
|
||||
|
||||
template <>
|
||||
struct begin_impl<array_tag>;
|
||||
struct begin_impl<boost_array_tag>;
|
||||
|
||||
template <>
|
||||
struct begin_impl<mpl_sequence_tag>;
|
||||
|
@ -14,7 +14,7 @@ namespace boost { namespace fusion
|
||||
// Special tags:
|
||||
struct sequence_facade_tag;
|
||||
struct boost_tuple_tag; // boost::tuples::tuple tag
|
||||
struct array_tag; // boost::array tag
|
||||
struct boost_array_tag; // boost::array tag
|
||||
struct mpl_sequence_tag; // mpl sequence tag
|
||||
struct std_pair_tag; // std::pair tag
|
||||
|
||||
@ -38,7 +38,7 @@ namespace boost { namespace fusion
|
||||
struct end_impl<boost_tuple_tag>;
|
||||
|
||||
template <>
|
||||
struct end_impl<array_tag>;
|
||||
struct end_impl<boost_array_tag>;
|
||||
|
||||
template <>
|
||||
struct end_impl<mpl_sequence_tag>;
|
||||
|
@ -19,7 +19,7 @@ namespace boost { namespace fusion
|
||||
|
||||
// Special tags:
|
||||
struct sequence_facade_tag;
|
||||
struct array_tag; // boost::array tag
|
||||
struct boost_array_tag; // boost::array tag
|
||||
struct mpl_sequence_tag; // mpl sequence tag
|
||||
struct std_pair_tag; // std::pair tag
|
||||
|
||||
@ -47,7 +47,7 @@ namespace boost { namespace fusion
|
||||
};
|
||||
|
||||
template <>
|
||||
struct has_key_impl<array_tag>;
|
||||
struct has_key_impl<boost_array_tag>;
|
||||
|
||||
template <>
|
||||
struct has_key_impl<mpl_sequence_tag>;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user