Merge pull request #105 from boostorg/variadics

Merge variadics into develop.
This commit is contained in:
Joel de Guzman
2015-10-22 15:40:04 +08:00
43 changed files with 1202 additions and 147 deletions

View File

@ -66,6 +66,11 @@ cases the most efficient.
template <typename T0, typename T1, typename T2..., typename TN> template <typename T0, typename T1, typename T2..., typename TN>
struct vectorN; struct vectorN;
[important Numbered forms will be deprecated in C++11 and it will be provided
via aliasing templates. It means that your partial specialization
might be compile error. You can detect whether it is aliasing
templates or not, using `BOOST_FUSION_HAS_VARIADIC_VECTOR`.]
[*Variadic form] [*Variadic form]
template < template <
@ -81,9 +86,11 @@ The numbered form accepts the exact number of elements. Example:
vector3<int, char, double> vector3<int, char, double>
The variadic form accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, where For C++11 compilers, the variadic function interface has no upper bound.
`FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that
defaults to `10`. Example: For C++03 compilers, the The variadic form accepts `0` to
`FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a
user definable predefined maximum that defaults to `10`. Example:
vector<int, char, double> vector<int, char, double>
@ -232,9 +239,11 @@ each element is peculiarly constant (see __recursive_inline__).
> >
struct list; struct list;
The variadic class interface accepts `0` to `FUSION_MAX_LIST_SIZE` For C++11 compilers, the variadic function interface has no upper bound.
elements, where `FUSION_MAX_LIST_SIZE` is a user definable predefined
maximum that defaults to `10`. Example: For C++03 compilers, the variadic class interface accepts `0` to
`FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user
definable predefined maximum that defaults to `10`. Example:
list<int, char, double> list<int, char, double>
@ -532,9 +541,11 @@ complexity (see __overloaded_functions__).
> >
struct set; struct set;
The variadic class interface accepts `0` to `FUSION_MAX_SET_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_SET_SIZE` is a user definable predefined maximum that
defaults to `10`. Example: For C++03 compilers, the variadic class interface accepts `0` to
`FUSION_MAX_SET_SIZE` elements, where `FUSION_MAX_SET_SIZE` is a user
definable predefined maximum that defaults to `10`. Example:
set<int, char, double> set<int, char, double>
@ -614,9 +625,11 @@ __overloaded_functions__).
> >
struct map; struct map;
The variadic class interface accepts `0` to `FUSION_MAX_MAP_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that
defaults to `10`. Example: For C++03 compilers, the variadic class interface accepts `0` to
`FUSION_MAX_MAP_SIZE` elements, where `FUSION_MAX_MAP_SIZE` is a user
definable predefined maximum that defaults to `10`. Example:
map<__pair__<int, char>, __pair__<char, char>, __pair__<double, char> > map<__pair__<int, char>, __pair__<char, char>, __pair__<double, char> >
@ -697,10 +710,13 @@ Create a __list__ from one or more values.
typename __result_of_make_list__<T0, T1,... TN>::type typename __result_of_make_list__<T0, T1,... TN>::type
make_list(T0 const& x0, T1 const& x1... TN const& xN); make_list(T0 const& x0, T1 const& x1... TN const& xN);
The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where For C++11 compilers, the variadic function interface has no upper bound.
`FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults
to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` For C++03 compilers, the variadic function accepts `0` to
before including any Fusion header to change the default. Example: `FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user
definable predefined maximum that defaults to `10`. You may define the
preprocessor constant `FUSION_MAX_LIST_SIZE` before including any Fusion
header to change the default. Example:
#define FUSION_MAX_LIST_SIZE 20 #define FUSION_MAX_LIST_SIZE 20
@ -794,11 +810,13 @@ Create a __vector__ from one or more values.
typename __result_of_make_vector__<T0, T1,... TN>::type typename __result_of_make_vector__<T0, T1,... TN>::type
make_vector(T0 const& x0, T1 const& x1... TN const& xN); make_vector(T0 const& x0, T1 const& x1... TN const& xN);
The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that
defaults to `10`. You may define the preprocessor constant For C++03 compilers, the variadic function accepts `0` to
`FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the `FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a
default. Example: user definable predefined maximum that defaults to `10`. You may define
the preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any
Fusion header to change the default. Example:
#define FUSION_MAX_VECTOR_SIZE 20 #define FUSION_MAX_VECTOR_SIZE 20
@ -896,11 +914,13 @@ Create a __set__ from one or more values.
typename __result_of_make_set__<T0, T1,... TN>::type typename __result_of_make_set__<T0, T1,... TN>::type
make_set(T0 const& x0, T1 const& x1... TN const& xN); make_set(T0 const& x0, T1 const& x1... TN const& xN);
The variadic function accepts `0` to `FUSION_MAX_SET_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_SET_SIZE` is a user definable predefined maximum that
defaults to `10`. You may define the preprocessor constant For C++03 compilers, the variadic function accepts `0` to
`FUSION_MAX_SET_SIZE` before including any Fusion header to change the `FUSION_MAX_SET_SIZE` elements, where `FUSION_MAX_SET_SIZE` is a user
default. Example: definable predefined maximum that defaults to `10`. You may define the
preprocessor constant `FUSION_MAX_SET_SIZE` before including any Fusion
header to change the default. Example:
#define FUSION_MAX_SET_SIZE 20 #define FUSION_MAX_SET_SIZE 20
@ -1049,10 +1069,13 @@ Constructs a tie using a __list__ sequence.
__list__<T0&, T1&,... TN&> __list__<T0&, T1&,... TN&>
list_tie(T0& x0, T1& x1... TN& xN); list_tie(T0& x0, T1& x1... TN& xN);
The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where For C++11 compilers, the variadic function interface has no upper bound.
`FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults
to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` For C++03 compilers, the variadic function accepts `0` to
before including any Fusion header to change the default. Example: `FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user
definable predefined maximum that defaults to `10`. You may define the
preprocessor constant `FUSION_MAX_LIST_SIZE` before including any Fusion
header to change the default. Example:
#define FUSION_MAX_LIST_SIZE 20 #define FUSION_MAX_LIST_SIZE 20
@ -1096,11 +1119,13 @@ Constructs a tie using a __vector__ sequence.
__vector__<T0&, T1&,... TN&> __vector__<T0&, T1&,... TN&>
vector_tie(T0& x0, T1& x1... TN& xN); vector_tie(T0& x0, T1& x1... TN& xN);
The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that
defaults to `10`. You may define the preprocessor constant For C++03 compilers, the variadic function accepts `0` to
`FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the `FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a
default. Example: user definable predefined maximum that defaults to `10`. You may define
the preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any
Fusion header to change the default. Example:
#define FUSION_MAX_VECTOR_SIZE 20 #define FUSION_MAX_VECTOR_SIZE 20
@ -1144,11 +1169,14 @@ Constructs a tie using a __map__ sequence.
__map__<__pair__<K0, D0&>, __pair__<K1, D1&>,... __pair__<KN, DN&> > __map__<__pair__<K0, D0&>, __pair__<K1, D1&>,... __pair__<KN, DN&> >
map_tie(D0& d0, D1& d1... DN& dN); map_tie(D0& d0, D1& d1... DN& dN);
The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that
defaults to `10`, and a corresponding number of key types. For C++03 compilers, the variadic function accepts `0` to
You may define the preprocessor constant `FUSION_MAX_MAP_SIZE` before `FUSION_MAX_MAP_SIZE` elements, where `FUSION_MAX_MAP_SIZE` is a user
including any Fusion header to change the default. Example: definable predefined maximum that defaults to `10`, and a corresponding
number of key types. You may define the preprocessor constant
`FUSION_MAX_MAP_SIZE` before including any Fusion header to change the
default. Example:
#define FUSION_MAX_MAP_SIZE 20 #define FUSION_MAX_MAP_SIZE 20
@ -1249,10 +1277,13 @@ Returns the result type of __make_list__.
template <typename T0, typename T1,... typename TN> template <typename T0, typename T1,... typename TN>
struct make_list; struct make_list;
The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where For C++11 compilers, the variadic function interface has no upper bound.
`FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults
to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` For C++03 compilers, the variadic function accepts `0` to
before including any Fusion header to change the default. Example: `FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user
definable predefined maximum that defaults to `10`. You may define the
preprocessor constant `FUSION_MAX_LIST_SIZE` before including any Fusion
header to change the default. Example:
#define FUSION_MAX_LIST_SIZE 20 #define FUSION_MAX_LIST_SIZE 20
@ -1333,11 +1364,13 @@ Returns the result type of __make_vector__.
template <typename T0, typename T1,... typename TN> template <typename T0, typename T1,... typename TN>
struct make_vector; struct make_vector;
The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that
defaults to `10`. You may define the preprocessor constant For C++03 compilers, the variadic function accepts `0` to
`FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the `FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a user
default. Example: definable predefined maximum that defaults to `10`. You may define the
preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion
header to change the default. Example:
#define FUSION_MAX_VECTOR_SIZE 20 #define FUSION_MAX_VECTOR_SIZE 20
@ -1427,11 +1460,13 @@ Returns the result type of __make_set__.
template <typename T0, typename T1,... typename TN> template <typename T0, typename T1,... typename TN>
struct make_set; struct make_set;
The variadic function accepts `0` to `FUSION_MAX_SET_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_SET_SIZE` is a user definable predefined maximum that
defaults to `10`. You may define the preprocessor constant For C++03 compilers, the variadic function accepts `0` to
`FUSION_MAX_SET_SIZE` before including any Fusion header to change the `FUSION_MAX_SET_SIZE` elements, where `FUSION_MAX_SET_SIZE` is a user definable
default. Example: predefined maximum that defaults to `10`. You may define the preprocessor
constant `FUSION_MAX_SET_SIZE` before including any Fusion header to change
the default. Example:
#define FUSION_MAX_SET_SIZE 20 #define FUSION_MAX_SET_SIZE 20
@ -1559,10 +1594,13 @@ Returns the result type of __list_tie__.
template <typename T0, typename T1,... typename TN> template <typename T0, typename T1,... typename TN>
struct list_tie; struct list_tie;
The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where For C++11 compilers, the variadic function interface has no upper bound.
`FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults
to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` For C++03 compilers, the variadic function accepts `0` to
before including any Fusion header to change the default. Example: `FUSION_MAX_LIST_SIZE` elements, where `FUSION_MAX_LIST_SIZE` is a user
definable predefined maximum that defaults to `10`. You may define the
preprocessor constant `FUSION_MAX_LIST_SIZE` before including any Fusion
header to change the default. Example:
#define FUSION_MAX_LIST_SIZE 20 #define FUSION_MAX_LIST_SIZE 20
@ -1603,11 +1641,13 @@ Returns the result type of __vector_tie__.
template <typename T0, typename T1,... typename TN> template <typename T0, typename T1,... typename TN>
struct vector_tie; struct vector_tie;
The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that
defaults to `10`. You may define the preprocessor constant For C++03 compilers, the variadic function accepts `0` to
`FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the `FUSION_MAX_VECTOR_SIZE` elements, where `FUSION_MAX_VECTOR_SIZE` is a user
default. Example: definable predefined maximum that defaults to `10`. You may define the
preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion
header to change the default. Example:
#define FUSION_MAX_VECTOR_SIZE 20 #define FUSION_MAX_VECTOR_SIZE 20
@ -1695,11 +1735,13 @@ Returns the result type of __map_tie__.
template <typename K0, typename K1,... typename KN, typename D0, typename D1,... typename DN> template <typename K0, typename K1,... typename KN, typename D0, typename D1,... typename DN>
struct map_tie; struct map_tie;
The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, For C++11 compilers, the variadic function interface has no upper bound.
where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that
defaults to `10`. You may define the preprocessor constant For C++03 compilers, the variadic function accepts `0` to
`FUSION_MAX_MAP_SIZE` before including any Fusion header to change the `FUSION_MAX_MAP_SIZE` elements, where `FUSION_MAX_MAP_SIZE` is a user definable
default. Example: predefined maximum that defaults to `10`. You may define the preprocessor
constant `FUSION_MAX_MAP_SIZE` before including any Fusion header to change
the default. Example:
#define FUSION_MAX_MAP_SIZE 20 #define FUSION_MAX_MAP_SIZE 20

View File

@ -10,7 +10,6 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/equal_to.hpp> #include <boost/fusion/iterator/equal_to.hpp>
#include <boost/fusion/iterator/mpl/convert_iterator.hpp> #include <boost/fusion/iterator/mpl/convert_iterator.hpp>
#include <boost/fusion/container/vector/vector10.hpp>
#include <boost/fusion/view/joint_view/joint_view.hpp> #include <boost/fusion/view/joint_view/joint_view.hpp>
#include <boost/fusion/view/iterator_range/iterator_range.hpp> #include <boost/fusion/view/iterator_range/iterator_range.hpp>
#include <boost/fusion/support/detail/as_fusion_element.hpp> #include <boost/fusion/support/detail/as_fusion_element.hpp>

View File

@ -10,7 +10,6 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/as_fusion_element.hpp> #include <boost/fusion/support/detail/as_fusion_element.hpp>
#include <boost/fusion/iterator/mpl/convert_iterator.hpp> #include <boost/fusion/iterator/mpl/convert_iterator.hpp>
#include <boost/fusion/container/vector/vector10.hpp>
#include <boost/fusion/view/joint_view/joint_view.hpp> #include <boost/fusion/view/joint_view/joint_view.hpp>
#include <boost/fusion/view/single_view/single_view.hpp> #include <boost/fusion/view/single_view/single_view.hpp>
#include <boost/fusion/view/iterator_range/iterator_range.hpp> #include <boost/fusion/view/iterator_range/iterator_range.hpp>

View File

@ -9,7 +9,6 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/mpl/convert_iterator.hpp> #include <boost/fusion/iterator/mpl/convert_iterator.hpp>
#include <boost/fusion/container/vector/vector10.hpp>
#include <boost/fusion/view/joint_view/joint_view.hpp> #include <boost/fusion/view/joint_view/joint_view.hpp>
#include <boost/fusion/view/iterator_range/iterator_range.hpp> #include <boost/fusion/view/iterator_range/iterator_range.hpp>
#include <boost/fusion/support/detail/as_fusion_element.hpp> #include <boost/fusion/support/detail/as_fusion_element.hpp>

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -10,7 +10,46 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/set/set.hpp> #include <boost/fusion/container/set/set.hpp>
#if !defined(BOOST_FUSION_HAS_VARIADIC_SET)
# include <boost/fusion/container/generation/detail/pp_make_set.hpp> # include <boost/fusion/container/generation/detail/pp_make_set.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 variadic interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/detail/as_fusion_element.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <utility>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename ...T>
struct make_set
{
typedef set<
typename detail::as_fusion_element<
typename remove_const<
typename remove_reference<T>::type
>::type
>::type...
> type;
};
}
template <typename ...T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::make_set<T...>::type
make_set(T&&... arg)
{
return typename result_of::make_set<T...>::type(std::forward<T>(arg)...);
}
}}
#endif #endif
#endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -10,7 +10,66 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/vector.hpp> #include <boost/fusion/container/vector/vector.hpp>
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/generation/detail/pp_make_vector.hpp> # include <boost/fusion/container/generation/detail/pp_make_vector.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 variadic interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/detail/as_fusion_element.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <utility>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename ...T>
struct make_vector
{
// make `make_vector<T..., void_...>' into `make_vector<T...>'
template <typename, typename...> struct trim_void;
template <typename... U>
struct trim_void<vector<U...> >
{
typedef vector<U...> type;
};
template <typename... U, typename... Tail>
struct trim_void<vector<U...>, void_, Tail...>
: trim_void<vector<U...> > { };
template <typename... U, typename Head, typename... Tail>
struct trim_void<vector<U...>, Head, Tail...>
: trim_void<vector<U..., Head>, Tail...> { };
typedef
typename trim_void<
vector<>
, typename detail::as_fusion_element<
typename remove_const<
typename remove_reference<T>::type
>::type
>::type...
>::type
type;
};
}
template <typename ...T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::make_vector<T...>::type
make_vector(T&&... arg)
{
return typename result_of::make_vector<T...>::type(std::forward<T>(arg)...);
}
}}
#endif #endif
#endif

View File

@ -8,8 +8,37 @@
#define FUSION_VECTOR_TIE_11112014_2302 #define FUSION_VECTOR_TIE_11112014_2302
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/generation/detail/pp_vector_tie.hpp> # include <boost/fusion/container/generation/detail/pp_vector_tie.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 variadic interface
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace fusion
{
namespace result_of
{
template <typename ...T>
struct vector_tie
{
typedef vector<T&...> type;
};
}
template <typename ...T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline vector<T&...>
vector_tie(T&... arg)
{
return vector<T&...>(arg...);
}
}}
#endif #endif
#endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -13,7 +13,55 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_SET)
# include <boost/fusion/container/set/detail/cpp03/as_set.hpp> # include <boost/fusion/container/set/detail/cpp03/as_set.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/detail/index_sequence.hpp>
#include <boost/fusion/container/set/set.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <cstddef>
namespace boost { namespace fusion { namespace detail
{
BOOST_FUSION_BARRIER_BEGIN
template <int size
, typename = typename detail::make_index_sequence<size>::type>
struct as_set;
template <int size, std::size_t ...Indices>
struct as_set<size, detail::index_sequence<Indices...> >
{
template <typename I>
struct apply
{
typedef set<
typename result_of::value_of<
typename result_of::advance_c<I, Indices>::type
>::type...
> type;
};
template <typename Iterator>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static typename apply<Iterator>::type
call(Iterator const& i)
{
typedef apply<Iterator> gen;
typedef typename gen::type result;
return result(*advance_c<Indices>(i)...);
}
};
BOOST_FUSION_BARRIER_END
}}}
#endif #endif
#endif

View File

@ -29,7 +29,7 @@ namespace boost { namespace fusion
template <typename Sequence> template <typename Sequence>
struct apply struct apply
{ {
typedef typename detail::as_set<result_of::size<Sequence>::value> gen; typedef detail::as_set<result_of::size<Sequence>::value> gen;
typedef typename gen:: typedef typename gen::
template apply<typename result_of::begin<Sequence>::type>::type template apply<typename result_of::begin<Sequence>::type>::type
type; type;

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -13,8 +13,126 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_SET)
# include <boost/fusion/container/set/detail/cpp03/set.hpp> # include <boost/fusion/container/set/detail/cpp03/set.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/support/detail/is_same_size.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/set/detail/begin_impl.hpp>
#include <boost/fusion/container/set/detail/end_impl.hpp>
#include <boost/fusion/container/set/detail/value_of_impl.hpp>
#include <boost/fusion/container/set/detail/deref_data_impl.hpp>
#include <boost/fusion/container/set/detail/deref_impl.hpp>
#include <boost/fusion/container/set/detail/key_of_impl.hpp>
#include <boost/fusion/container/set/detail/value_of_data_impl.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/core/enable_if.hpp>
namespace boost { namespace fusion
{
struct fusion_sequence_tag;
template <>
struct set<> : sequence_base<set<> >
{
struct category : forward_traversal_tag, associative_tag {};
typedef set_tag fusion_tag;
typedef fusion_sequence_tag tag; // this gets picked up by MPL
typedef mpl::false_ is_view;
typedef vector<> storage_type;
typedef storage_type::size size;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set()
: data() {}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs,
typename enable_if<traits::is_sequence<Sequence> >::type* = 0,
typename enable_if<detail::is_same_size<Sequence, storage_type> >::type* = 0)
: data(rhs) {}
template <typename T>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set&
operator=(T const& rhs)
{
data = rhs;
return *this;
}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type& get_data() { return data; }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type const& get_data() const { return data; }
private:
storage_type data;
};
template <typename ...T>
struct set : sequence_base<set<T...> >
{
struct category : forward_traversal_tag, associative_tag {};
typedef set_tag fusion_tag;
typedef fusion_sequence_tag tag; // this gets picked up by MPL
typedef mpl::false_ is_view;
typedef vector<T...> storage_type;
typedef typename storage_type::size size;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set()
: data() {}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
set(Sequence&& rhs,
typename enable_if<traits::is_sequence<Sequence> >::type* = 0,
typename enable_if<detail::is_same_size<Sequence, storage_type> >::type* = 0)
: data(std::forward<Sequence>(rhs)) {}
template <typename ...U>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit
set(U&& ...args)
: data(std::forward<U>(args)...) {}
template <typename U>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set&
operator=(U&& rhs)
{
data = std::forward<U>(rhs);
return *this;
}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type& get_data() { return data; }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type const& get_data() const { return data; }
private:
storage_type data;
};
}}
#endif
#endif #endif

View File

@ -9,11 +9,38 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR) \
|| (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
# if defined(BOOST_FUSION_HAS_VARIADIC_SET)
# undef BOOST_FUSION_HAS_VARIADIC_SET
# endif
#else
# if !defined(BOOST_FUSION_HAS_VARIADIC_SET)
# define BOOST_FUSION_HAS_VARIADIC_SET
# endif
#endif
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// With no variadics, we will use the C++03 version // With no variadics, we will use the C++03 version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_SET)
# include <boost/fusion/container/set/detail/cpp03/set_fwd.hpp> # include <boost/fusion/container/set/detail/cpp03/set_fwd.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace fusion
{
struct set_tag;
struct set_iterator_tag;
template <typename ...T>
struct set;
}}
#endif #endif
#endif

View File

@ -8,25 +8,8 @@
#define FUSION_SEQUENCE_CLASS_VECTOR_10022005_0602 #define FUSION_SEQUENCE_CLASS_VECTOR_10022005_0602
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/cpp03/limits.hpp>
#include <boost/fusion/container/vector/vector10.hpp>
#if (FUSION_MAX_VECTOR_SIZE > 10)
#include <boost/fusion/container/vector/vector20.hpp>
#endif
#if (FUSION_MAX_VECTOR_SIZE > 20)
#include <boost/fusion/container/vector/vector30.hpp>
#endif
#if (FUSION_MAX_VECTOR_SIZE > 30)
#include <boost/fusion/container/vector/vector40.hpp>
#endif
#if (FUSION_MAX_VECTOR_SIZE > 40)
#include <boost/fusion/container/vector/vector50.hpp>
#endif
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/vector/vector_fwd.hpp> #include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/fusion/container/vector/vector_iterator.hpp> #include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/vector/convert.hpp> #include <boost/fusion/container/vector/convert.hpp>
#endif #endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -8,12 +8,63 @@
#define FUSION_AS_VECTOR_11052014_1801 #define FUSION_AS_VECTOR_11052014_1801
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/as_vector.hpp> # include <boost/fusion/container/vector/detail/cpp03/as_vector.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/detail/index_sequence.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <cstddef>
namespace boost { namespace fusion { namespace detail
{
BOOST_FUSION_BARRIER_BEGIN
template <typename Indices>
struct as_vector_impl;
template <std::size_t ...Indices>
struct as_vector_impl<index_sequence<Indices...> >
{
template <typename Iterator>
struct apply
{
typedef vector<
typename result_of::value_of<
typename result_of::advance_c<Iterator, Indices>::type
>::type...
> type;
};
template <typename Iterator>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static typename apply<Iterator>::type
call(Iterator i)
{
typedef typename apply<Iterator>::type result;
return result(*advance_c<Indices>(i)...);
}
};
template <int size>
struct as_vector
: as_vector_impl<typename make_index_sequence<size>::type> {};
BOOST_FUSION_BARRIER_END
}}}
#endif
#endif #endif

View File

@ -9,9 +9,8 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/access.hpp> #include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/fusion/container/vector/detail/value_at_impl.hpp>
#include <boost/mpl/at.hpp> #include <boost/static_assert.hpp>
#include <boost/mpl/int.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -28,7 +27,7 @@ namespace boost { namespace fusion
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct apply struct apply
{ {
typedef typename mpl::at<typename Sequence::types, N>::type element; typedef typename value_at_impl<vector_tag>::template apply<Sequence, N>::type element;
typedef typename detail::ref_result<element>::type type; typedef typename detail::ref_result<element>::type type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
@ -43,7 +42,7 @@ namespace boost { namespace fusion
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct apply <Sequence const, N> struct apply <Sequence const, N>
{ {
typedef typename mpl::at<typename Sequence::types, N>::type element; typedef typename value_at_impl<vector_tag>::template apply<Sequence, N>::type element;
typedef typename detail::cref_result<element>::type type; typedef typename detail::cref_result<element>::type type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED

View File

@ -0,0 +1,36 @@
/*=============================================================================
Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef FUSION_VECTOR_CONFIG_11052014_1720
#define FUSION_VECTOR_CONFIG_11052014_1720
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/fusion/support/config.hpp>
#if (defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) \
|| defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|| defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) \
|| defined(BOOST_NO_CXX11_DECLTYPE)) \
|| (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
# if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# undef BOOST_FUSION_HAS_VARIADIC_VECTOR
# endif
#else
# if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# define BOOST_FUSION_HAS_VARIADIC_VECTOR
# endif
#endif
// Sometimes, MSVC 12 shows compile error with std::size_t of template parameter.
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1800))
# if defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# undef BOOST_FUSION_HAS_VARIADIC_VECTOR
# endif
#endif
#endif

View File

@ -9,6 +9,7 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/support/detail/pp_round.hpp> #include <boost/fusion/support/detail/pp_round.hpp>
#include <boost/preprocessor/stringize.hpp>
#if !defined(FUSION_MAX_VECTOR_SIZE) #if !defined(FUSION_MAX_VECTOR_SIZE)
# define FUSION_MAX_VECTOR_SIZE 10 # define FUSION_MAX_VECTOR_SIZE 10

View File

@ -8,8 +8,8 @@
#define FUSION_DEREF_IMPL_05042005_1037 #define FUSION_DEREF_IMPL_05042005_1037
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/at.hpp>
#include <boost/fusion/support/detail/access.hpp> #include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/container/vector/detail/value_at_impl.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
@ -30,9 +30,7 @@ namespace boost { namespace fusion
{ {
typedef typename Iterator::vector vector; typedef typename Iterator::vector vector;
typedef typename Iterator::index index; typedef typename Iterator::index index;
typedef typename mpl::at< typedef typename value_at_impl<vector_tag>::template apply<vector, index>::type element;
typename vector::types, index>::type
element;
typedef typename typedef typename
mpl::if_< mpl::if_<

View File

@ -9,11 +9,50 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/value_at_impl.hpp> # include <boost/fusion/container/vector/detail/cpp03/value_at_impl.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/type_traits/declval.hpp>
#include <boost/type_traits/remove_cv.hpp>
namespace boost { namespace fusion
{
struct vector_tag;
namespace vector_detail
{
template <typename I, typename ...T>
struct vector_data;
}
namespace extension
{
template <typename Tag>
struct value_at_impl;
template <>
struct value_at_impl<vector_tag>
{
template <typename Sequence, typename N>
struct apply
{
typedef typename boost::remove_cv<Sequence>::type seq;
typedef decltype(seq::template value_at_impl<N::value>(boost::declval<seq*>())) type;
};
};
}
}}
#endif #endif
#endif

View File

@ -8,7 +8,7 @@
#define FUSION_VALUE_OF_IMPL_05052005_1128 #define FUSION_VALUE_OF_IMPL_05052005_1128
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/at.hpp> #include <boost/fusion/container/vector/detail/value_at_impl.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -27,9 +27,7 @@ namespace boost { namespace fusion
{ {
typedef typename Iterator::vector vector; typedef typename Iterator::vector vector;
typedef typename Iterator::index index; typedef typename Iterator::index index;
typedef typename mpl::at< typedef typename value_at_impl<vector_tag>::template apply<vector, index>::type type;
typename vector::types, index>::type
type;
}; };
}; };
} }

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -9,12 +9,320 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
#include <boost/fusion/container/vector/vector_fwd.hpp> #include <boost/fusion/container/vector/vector_fwd.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/vector.hpp> # include <boost/fusion/container/vector/detail/cpp03/vector.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/support/detail/index_sequence.hpp>
#include <boost/fusion/container/vector/detail/at_impl.hpp>
#include <boost/fusion/container/vector/detail/value_at_impl.hpp>
#include <boost/fusion/container/vector/detail/begin_impl.hpp>
#include <boost/fusion/container/vector/detail/end_impl.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/iterator/advance.hpp>
#include <boost/fusion/iterator/deref.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <cstddef>
#include <utility>
namespace boost { namespace fusion
{
struct vector_tag;
struct random_access_traversal_tag;
namespace vector_detail
{
struct each_elem {};
struct copy_or_move {};
template <typename I> struct from_sequence {};
template <typename Sequence>
struct make_indices_from_seq
: detail::make_index_sequence<
fusion::result_of::size<typename remove_reference<Sequence>::type>::value
>
{};
template <typename T>
struct pure : remove_cv<typename remove_reference<T>::type> {};
template <typename This, typename ...T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline each_elem
dispatch(T const&...) BOOST_NOEXCEPT { return each_elem(); }
template <typename This>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline copy_or_move
dispatch(This const&) BOOST_NOEXCEPT { return copy_or_move(); }
template <typename This, typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline from_sequence<
typename lazy_enable_if_c<
(traits::is_sequence<Sequence>::value &&
!is_same<This, Sequence>::value)
, make_indices_from_seq<Sequence>
>::type
>
dispatch(Sequence const&) BOOST_NOEXCEPT
{ return from_sequence<typename make_indices_from_seq<Sequence>::type>(); }
// forward_at_c allows to access Nth element even if ForwardSequence
// since fusion::at_c requires RandomAccessSequence.
namespace result_of
{
template <typename Sequence, int N>
struct forward_at_c
: fusion::result_of::deref<
typename fusion::result_of::advance_c<
typename fusion::result_of::begin<
typename remove_reference<Sequence>::type
>::type
, N
>::type
>
{};
}
template <int N, typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::forward_at_c<Sequence, N>::type
forward_at_c(Sequence&& seq)
{
typedef typename
result_of::forward_at_c<Sequence, N>::type
result;
return std::forward<result>(*advance_c<N>(begin(seq)));
}
// Object proxy since preserve object order
template <std::size_t, typename T>
struct store
{
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
store()
: elem() // value-initialized explicitly
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
store(store const& rhs)
: elem(rhs.get())
{}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
store&
operator=(store const& rhs)
{
elem = rhs.get();
return *this;
}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
store(store&& rhs)
: elem(static_cast<T&&>(rhs.get()))
{}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
store&
operator=(store&& rhs)
{
elem = static_cast<T&&>(rhs.get());
return *this;
}
template <typename U>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
store(U&& rhs
, typename disable_if<is_same<typename pure<U>::type, store> >::type* = 0)
: elem(std::forward<U>(rhs))
{}
template <typename U>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
typename disable_if<is_same<typename pure<U>::type, store>, store&>::type
operator=(U&& rhs)
{
elem = std::forward<U>(rhs);
return *this;
}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
T & get() { return elem; }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
T const& get() const { return elem; }
T elem;
};
template <typename I, typename ...T>
struct vector_data;
template <std::size_t ...I, typename ...T>
struct vector_data<detail::index_sequence<I...>, T...>
: store<I, T>...
, sequence_base<vector_data<detail::index_sequence<I...>, T...> >
{
typedef vector_tag fusion_tag;
typedef fusion_sequence_tag tag; // this gets picked up by MPL
typedef mpl::false_ is_view;
typedef random_access_traversal_tag category;
typedef mpl::int_<sizeof...(T)> size;
typedef vector<T...> type_sequence;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector_data()
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector_data(copy_or_move, vector_data const& rhs)
: store<I, T>(static_cast<store<I, T> const&>(rhs))...
{}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector_data(copy_or_move, vector_data&& rhs)
: store<I, T>(std::forward<store<I, T> >(rhs))...
{}
template <typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit
vector_data(from_sequence<detail::index_sequence<I...> >, Sequence&& rhs)
: store<I, T>(forward_at_c<I>(rhs))...
{}
template <typename ...U>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit
vector_data(each_elem, U&&... var)
: store<I, T>(std::forward<U>(var))...
{}
template <typename Sequence>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
void
assign(Sequence&&, detail::index_sequence<>) {}
template <typename Sequence, std::size_t N, std::size_t ...M>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
void
assign(Sequence&& seq, detail::index_sequence<N, M...>)
{
at_impl(mpl::int_<N>()) = vector_detail::forward_at_c<N>(seq);
assign(std::forward<Sequence>(seq), detail::index_sequence<M...>());
}
template <std::size_t N, typename U>
static BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
auto at_detail(store<N, U>* this_) -> decltype(this_->get())
{
return this_->get();
}
template <std::size_t N, typename U>
static BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
auto at_detail(store<N, U> const* this_) -> decltype(this_->get())
{
return this_->get();
}
template <typename J>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
auto at_impl(J) -> decltype(at_detail<J::value>(this))
{
return at_detail<J::value>(this);
}
template <typename J>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
auto at_impl(J) const -> decltype(at_detail<J::value>(this))
{
return at_detail<J::value>(this);
}
template <std::size_t N, typename U>
static BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
U value_at_impl(store<N, U>*);
};
template <typename V, typename... T>
struct trim_void_;
template <typename... T>
struct trim_void_<vector<T...> >
{
typedef vector_data<
typename detail::make_index_sequence<sizeof...(T)>::type
, T...
> type;
};
template <typename... T, typename... Tail>
struct trim_void_<vector<T...>, void_, Tail...>
: trim_void_<vector<T...> > {};
template <typename... T, typename Head, typename... Tail>
struct trim_void_<vector<T...>, Head, Tail...>
: trim_void_<vector<T..., Head>, Tail...> {};
template <typename... T>
struct trim_void : trim_void_<vector<>, T...> {};
} // namespace boost::fusion::vector_detail
// This class provides backward compatibility: vector<T, ..., void_, void_, ...>.
template <typename... T>
struct vector
: vector_detail::trim_void<T...>::type
{
typedef typename vector_detail::trim_void<T...>::type base;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector()
{}
// rvalue-references is required here in order to forward any arguments to
// base: vector(T const&...) doesn't work with trailing void_ and
// vector(U const&...) cannot forward any arguments to base.
template <typename... U>
// XXX: constexpr become error due to pull-request #79, booooo!!
// In the (near) future release, should be fixed.
/* BOOST_CONSTEXPR */ BOOST_FUSION_GPU_ENABLED
vector(U&&... u)
: base(vector_detail::dispatch<vector>(u...), std::forward<U>(u)...)
{}
template <typename Sequence>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
vector&
operator=(Sequence&& rhs)
{
typedef typename
vector_detail::make_indices_from_seq<Sequence>::type
indices;
base::assign(std::forward<Sequence>(rhs), indices());
return *this;
}
};
}}
#endif #endif
#endif

View File

@ -9,11 +9,21 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/vector10.hpp> # include <boost/fusion/container/vector/detail/cpp03/vector10.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#endif #endif
#endif

View File

@ -9,11 +9,21 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/vector20.hpp> # include <boost/fusion/container/vector/detail/cpp03/vector20.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#endif #endif
#endif

View File

@ -9,11 +9,21 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/vector30.hpp> # include <boost/fusion/container/vector/detail/cpp03/vector30.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#endif #endif
#endif

View File

@ -9,11 +9,21 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/vector40.hpp> # include <boost/fusion/container/vector/detail/cpp03/vector40.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#endif #endif
#endif

View File

@ -9,11 +9,21 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/vector50.hpp> # include <boost/fusion/container/vector/detail/cpp03/vector50.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#endif #endif
#endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -9,11 +9,35 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// With no variadics, we will use the C++03 version // With no variadics, we will use the C++03 version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/vector_fwd.hpp> # include <boost/fusion/container/vector/detail/cpp03/vector_fwd.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
namespace boost { namespace fusion
{
template <typename ...T>
struct vector;
#define FUSION_VECTOR_N_ALIASES(z, N, d) \
template <typename ...T> \
using BOOST_PP_CAT(vector, N) = vector<T...>;
BOOST_PP_REPEAT(51, FUSION_VECTOR_N_ALIASES, ~)
#undef FUSION_VECTOR_N_ALIASES
}}
#endif #endif
#endif

View File

@ -9,16 +9,21 @@
#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_LIMITS_HPP_INCLUDED) #if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_LIMITS_HPP_INCLUDED)
# define BOOST_FUSION_FUNCTIONAL_ADAPTER_LIMITS_HPP_INCLUDED # define BOOST_FUSION_FUNCTIONAL_ADAPTER_LIMITS_HPP_INCLUDED
# include <boost/fusion/container/vector/detail/cpp03/limits.hpp> # include <boost/fusion/container/vector/detail/config.hpp>
# if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/container/vector/detail/cpp03/limits.hpp>
# endif
# if !defined(BOOST_FUSION_UNFUSED_MAX_ARITY) # if !defined(BOOST_FUSION_UNFUSED_MAX_ARITY)
# define BOOST_FUSION_UNFUSED_MAX_ARITY 6 # define BOOST_FUSION_UNFUSED_MAX_ARITY 6
# elif BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY > FUSION_MAX_VECTOR_SIZE # elif !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR) && \
(BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY > FUSION_MAX_VECTOR_SIZE)
# error "BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY > FUSION_MAX_VECTOR_SIZE" # error "BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY > FUSION_MAX_VECTOR_SIZE"
# endif # endif
# if !defined(BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY) # if !defined(BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY)
# define BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY 6 # define BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY 6
# elif BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY > FUSION_MAX_VECTOR_SIZE # elif !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR) && \
(BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY > FUSION_MAX_VECTOR_SIZE)
# error "BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY > FUSION_MAX_VECTOR_SIZE" # error "BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY > FUSION_MAX_VECTOR_SIZE"
# endif # endif

View File

@ -0,0 +1,29 @@
/*=============================================================================
Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef FUSION_IS_SAME_SIZE_10082015_1156
#define FUSION_IS_SAME_SIZE_10082015_1156
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/equal_to.hpp>
namespace boost { namespace fusion { namespace detail
{
template <typename Sequence1, typename Sequence2, typename = void, typename = void>
struct is_same_size : mpl::false_ {};
template <typename Sequence1, typename Sequence2>
struct is_same_size<Sequence1, Sequence2,
typename enable_if<traits::is_sequence<Sequence1> >::type,
typename enable_if<traits::is_sequence<Sequence2> >::type>
: mpl::equal_to<result_of::size<Sequence1>, result_of::size<Sequence2> >
{};
}}}
#endif

View File

@ -13,7 +13,38 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// With no variadics, we will use the C++03 version // With no variadics, we will use the C++03 version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_TUPLE)
# include <boost/fusion/tuple/detail/make_tuple.hpp> # include <boost/fusion/tuple/detail/make_tuple.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/detail/as_fusion_element.hpp>
#include <boost/fusion/tuple/tuple.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
namespace boost { namespace fusion
{
template <typename ...T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline tuple<typename detail::as_fusion_element<
typename remove_const<
typename remove_reference<T>::type
>::type
>::type...>
make_tuple(T&&... arg)
{
typedef tuple<typename detail::as_fusion_element<
typename remove_const<
typename remove_reference<T>::type
>::type
>::type...> result_type;
return result_type(std::forward<T>(arg)...);
}
}}
#endif #endif
#endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -13,7 +13,80 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// With no variadics, we will use the C++03 version // With no variadics, we will use the C++03 version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_TUPLE)
# include <boost/fusion/tuple/detail/tuple.hpp> # include <boost/fusion/tuple/detail/tuple.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/comparison.hpp>
#include <boost/fusion/sequence/io.hpp>
#include <utility>
namespace boost { namespace fusion
{
template <typename ...T>
struct tuple : vector<T...>
{
typedef vector<T...> base_type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
tuple()
: base_type() {}
template <typename ...U>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
tuple(tuple<U...> const& other)
: base_type(other) {}
template <typename ...U>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
tuple(tuple<U...>&& other)
: base_type(std::move(other)) {}
template <typename ...U>
/*BOOST_CONSTEXPR*/ BOOST_FUSION_GPU_ENABLED
explicit
tuple(U&&... args)
: base_type(std::forward<U>(args)...) {}
template <typename U>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
tuple& operator=(U&& rhs)
{
base_type::operator=(std::forward<U>(rhs));
return *this;
}
};
template <typename Tuple>
struct tuple_size : result_of::size<Tuple> {};
template <int N, typename Tuple>
struct tuple_element : result_of::value_at_c<Tuple, N> {};
template <int N, typename Tuple>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::at_c<Tuple, N>::type
get(Tuple& tup)
{
return at_c<N>(tup);
}
template <int N, typename Tuple>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline typename result_of::at_c<Tuple const, N>::type
get(Tuple const& tup)
{
return at_c<N>(tup);
}
}}
#endif #endif
#endif

View File

@ -1,5 +1,5 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2014 Kohei Takahashi Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -9,11 +9,35 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR) \
|| (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
# if defined(BOOST_FUSION_HAS_VARIADIC_TUPLE)
# undef BOOST_FUSION_HAS_VARIADIC_TUPLE
# endif
#else
# if !defined(BOOST_FUSION_HAS_VARIADIC_TUPLE)
# define BOOST_FUSION_HAS_VARIADIC_TUPLE
# endif
#endif
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// With no variadics, we will use the C++03 version // With no variadics, we will use the C++03 version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_TUPLE)
# include <boost/fusion/tuple/detail/tuple_fwd.hpp> # include <boost/fusion/tuple/detail/tuple_fwd.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace fusion
{
template <typename ...T>
struct tuple;
}}
#endif #endif
#endif

View File

@ -13,7 +13,26 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// With no variadics, we will use the C++03 version // With no variadics, we will use the C++03 version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_TUPLE)
# include <boost/fusion/tuple/detail/tuple_tie.hpp> # include <boost/fusion/tuple/detail/tuple_tie.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/tuple/tuple.hpp>
namespace boost { namespace fusion
{
template <typename ...T>
BOOST_FUSION_GPU_ENABLED
inline tuple<T&...>
tie(T&... arg)
{
return tuple<T&...>(arg...);
}
}}
#endif #endif
#endif

View File

@ -1,7 +1,7 @@
/*============================================================================= /*=============================================================================
Copyright (c) 2009 Hartmut Kaiser Copyright (c) 2009 Hartmut Kaiser
Distributed under the Boost Software License, Version 1.0. (See accompanying Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/ ==============================================================================*/
@ -9,7 +9,6 @@
#define BOOST_FUSION_NVIEW_ADVANCE_IMPL_SEP_24_2009_0212PM #define BOOST_FUSION_NVIEW_ADVANCE_IMPL_SEP_24_2009_0212PM
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/advance.hpp>
#include <boost/fusion/iterator/advance.hpp> #include <boost/fusion/iterator/advance.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
@ -30,11 +29,11 @@ namespace boost { namespace fusion
template<typename Iterator, typename Dist> template<typename Iterator, typename Dist>
struct apply struct apply
{ {
typedef typename Iterator::first_type::iterator_type iterator_type; typedef typename Iterator::first_type iterator_type;
typedef typename Iterator::sequence_type sequence_type; typedef typename Iterator::sequence_type sequence_type;
typedef nview_iterator<sequence_type, typedef nview_iterator<sequence_type,
typename mpl::advance<iterator_type, Dist>::type> type; typename result_of::advance<iterator_type, Dist>::type> type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type static type

View File

@ -10,6 +10,7 @@
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/sequence/intrinsic/at.hpp> #include <boost/fusion/sequence/intrinsic/at.hpp>
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -29,7 +30,7 @@ namespace boost { namespace fusion
typedef typename Sequence::sequence_type sequence_type; typedef typename Sequence::sequence_type sequence_type;
typedef typename Sequence::index_type index_type; typedef typename Sequence::index_type index_type;
typedef typename result_of::at<index_type, N>::type index; typedef typename result_of::value_at<index_type, N>::type index;
typedef typename result_of::at<sequence_type, index>::type type; typedef typename result_of::at<sequence_type, index>::type type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED

View File

@ -9,7 +9,6 @@
#define BOOST_FUSION_NVIEW_BEGIN_IMPL_SEP_23_2009_1036PM #define BOOST_FUSION_NVIEW_BEGIN_IMPL_SEP_23_2009_1036PM
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/begin.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp> #include <boost/fusion/sequence/intrinsic/begin.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
@ -32,8 +31,8 @@ namespace boost { namespace fusion
{ {
typedef typename Sequence::index_type index_type; typedef typename Sequence::index_type index_type;
typedef nview_iterator<Sequence, typedef nview_iterator<Sequence,
typename mpl::begin<index_type>::type> type; typename result_of::begin<index_type>::type> type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence& s) static type call(Sequence& s)

View File

@ -17,10 +17,13 @@
#include <boost/preprocessor/repetition/enum_params.hpp> #include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp> #include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/fusion/adapted/mpl.hpp>
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
#define BOOST_PP_ITERATION_PARAMS_1 \ #define BOOST_PP_ITERATION_PARAMS_1 \
(3, (1, FUSION_MAX_VECTOR_SIZE, \ (3, (1, FUSION_MAX_VECTOR_SIZE, \
"boost/fusion/view/nview/detail/cpp03/nview_impl.hpp")) \ "boost/fusion/view/nview/detail/cpp03/nview_impl.hpp")) \
/**/ /**/
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -9,8 +9,8 @@
#define BOOST_FUSION_NVIEW_DEREF_IMPL_SEP_24_2009_0818AM #define BOOST_FUSION_NVIEW_DEREF_IMPL_SEP_24_2009_0818AM
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/iterator/deref.hpp> #include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/container/vector.hpp> #include <boost/fusion/sequence/intrinsic/at.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -30,7 +30,7 @@ namespace boost { namespace fusion
typedef typename Iterator::first_type first_type; typedef typename Iterator::first_type first_type;
typedef typename Iterator::sequence_type sequence_type; typedef typename Iterator::sequence_type sequence_type;
typedef typename result_of::deref<first_type>::type index; typedef typename result_of::value_of<first_type>::type index;
typedef typename result_of::at< typedef typename result_of::at<
typename sequence_type::sequence_type, index>::type type; typename sequence_type::sequence_type, index>::type type;

View File

@ -9,7 +9,6 @@
#define BOOST_FUSION_NVIEW_END_IMPL_SEP_24_2009_0140PM #define BOOST_FUSION_NVIEW_END_IMPL_SEP_24_2009_0140PM
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/end.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp> #include <boost/fusion/sequence/intrinsic/end.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
@ -33,8 +32,8 @@ namespace boost { namespace fusion
{ {
typedef typename Sequence::index_type index_type; typedef typename Sequence::index_type index_type;
typedef nview_iterator<Sequence, typedef nview_iterator<Sequence,
typename mpl::end<index_type>::type> type; typename result_of::end<index_type>::type> type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type call(Sequence& s) static type call(Sequence& s)

View File

@ -9,7 +9,7 @@
#define BOOST_FUSION_NVIEW_NEXT_IMPL_SEP_24_2009_0116PM #define BOOST_FUSION_NVIEW_NEXT_IMPL_SEP_24_2009_0116PM
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/next.hpp> #include <boost/fusion/iterator/next.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -27,13 +27,13 @@ namespace boost { namespace fusion
struct next_impl<nview_iterator_tag> struct next_impl<nview_iterator_tag>
{ {
template <typename Iterator> template <typename Iterator>
struct apply struct apply
{ {
typedef typename Iterator::first_type::iterator_type first_type; typedef typename Iterator::first_type first_type;
typedef typename Iterator::sequence_type sequence_type; typedef typename Iterator::sequence_type sequence_type;
typedef nview_iterator<sequence_type, typedef nview_iterator<sequence_type,
typename mpl::next<first_type>::type> type; typename result_of::next<first_type>::type> type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type static type

View File

@ -8,11 +8,43 @@
#define BOOST_FUSION_NVIEW_IMPL_17122014_1948 #define BOOST_FUSION_NVIEW_IMPL_17122014_1948
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/config.hpp>
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version // Without variadics, we will use the PP version
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_VECTOR)
# include <boost/fusion/view/nview/detail/cpp03/nview_impl.hpp> # include <boost/fusion/view/nview/detail/cpp03/nview_impl.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/vector.hpp>
#include <boost/mpl/int.hpp>
namespace boost { namespace fusion
{
namespace result_of
{
template <typename Sequence, int ...I>
struct as_nview
{
typedef vector<mpl::int_<I>...> index_type;
typedef nview<Sequence, index_type> type;
};
}
template <int ...I, typename Sequence>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
inline nview<Sequence, vector<mpl::int_<I>...> >
as_nview(Sequence& s)
{
typedef vector<mpl::int_<I>...> index_type;
return nview<Sequence, index_type>(s);
}
}}
#endif #endif
#endif

View File

@ -9,7 +9,7 @@
#define BOOST_FUSION_NVIEW_PRIOR_IMPL_SEP_24_2009_0142PM #define BOOST_FUSION_NVIEW_PRIOR_IMPL_SEP_24_2009_0142PM
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/prior.hpp> #include <boost/fusion/iterator/prior.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -27,13 +27,13 @@ namespace boost { namespace fusion
struct prior_impl<nview_iterator_tag> struct prior_impl<nview_iterator_tag>
{ {
template <typename Iterator> template <typename Iterator>
struct apply struct apply
{ {
typedef typename Iterator::first_type::iterator_type first_type; typedef typename Iterator::first_type first_type;
typedef typename Iterator::sequence_type sequence_type; typedef typename Iterator::sequence_type sequence_type;
typedef nview_iterator<sequence_type, typedef nview_iterator<sequence_type,
typename mpl::prior<first_type>::type> type; typename result_of::prior<first_type>::type> type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
static type static type

View File

@ -9,19 +9,15 @@
#define BOOST_FUSION_NVIEW_SEP_23_2009_0948PM #define BOOST_FUSION_NVIEW_SEP_23_2009_0948PM
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
#include <boost/mpl/vector_c.hpp>
#include <boost/utility/result_of.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/type_traits/add_reference.hpp> #include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/add_const.hpp> #include <boost/type_traits/add_const.hpp>
#include <boost/fusion/support/is_view.hpp> #include <boost/fusion/support/is_view.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/support/sequence_base.hpp> #include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/container/vector.hpp> #include <boost/fusion/container/vector.hpp>
#include <boost/fusion/sequence/intrinsic/size.hpp>
#include <boost/fusion/view/transform_view.hpp> #include <boost/fusion/view/transform_view.hpp>
#include <boost/config.hpp> #include <boost/config.hpp>
@ -99,7 +95,7 @@ namespace boost { namespace fusion
typedef mpl::true_ is_view; typedef mpl::true_ is_view;
typedef Indicies index_type; typedef Indicies index_type;
typedef typename mpl::size<Indicies>::type size; typedef typename result_of::size<Indicies>::type size;
typedef typename mpl::if_< typedef typename mpl::if_<
is_const<Sequence>, detail::addconstref, detail::addref is_const<Sequence>, detail::addconstref, detail::addref

View File

@ -12,7 +12,6 @@
#include <boost/fusion/support/category_of.hpp> #include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp> #include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/sequence/intrinsic/end.hpp> #include <boost/fusion/sequence/intrinsic/end.hpp>
#include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
#include <boost/fusion/view/nview/detail/size_impl.hpp> #include <boost/fusion/view/nview/detail/size_impl.hpp>
#include <boost/fusion/view/nview/detail/begin_impl.hpp> #include <boost/fusion/view/nview/detail/begin_impl.hpp>
@ -40,7 +39,7 @@ namespace boost { namespace fusion
typedef random_access_traversal_tag category; typedef random_access_traversal_tag category;
typedef Sequence sequence_type; typedef Sequence sequence_type;
typedef mpl_iterator<Pos> first_type; typedef Pos first_type;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit nview_iterator(Sequence& in_seq) explicit nview_iterator(Sequence& in_seq)