mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-24 01:27:37 +02:00
Likewise.
This commit is contained in:
@ -309,7 +309,7 @@ __front_extended_deque__ and __back_extended_deque__.
|
||||
|
||||
#include <boost/fusion/container/deque.hpp>
|
||||
#include <boost/fusion/include/deque.hpp>
|
||||
#include <boost/fusion/container/list/deque_fwd.hpp>
|
||||
#include <boost/fusion/container/deque/deque_fwd.hpp>
|
||||
#include <boost/fusion/include/deque_fwd.hpp>
|
||||
|
||||
[heading Synopsis]
|
||||
|
@ -400,7 +400,7 @@ producing a conforming Fusion sequence.
|
||||
[heading Usage]
|
||||
The user of __sequence_facade__ derives his sequence type from a specialization of __sequence_facade__ and passes the derived sequence type as the first template parameter. The second template parameter should be the traversal category of the sequence being implemented. The 3rd parameter should be set to `mpl::true_` if the sequence is a view.
|
||||
|
||||
The user must the implement the key expressions required by their sequence type.
|
||||
The user must implement the key expressions required by their sequence type.
|
||||
|
||||
[table Parameters
|
||||
[[Name][Description]]
|
||||
@ -447,7 +447,7 @@ producing a conforming Fusion iterator.
|
||||
[heading Usage]
|
||||
The user of iterator_facade derives his iterator type from a specialization of iterator_facade and passes the derived iterator type as the first template parameter. The second template parameter should be the traversal category of the iterator being implemented.
|
||||
|
||||
The user must the implement the key expressions required by their iterator type.
|
||||
The user must implement the key expressions required by their iterator type.
|
||||
|
||||
[table Parameters
|
||||
[[Name][Description]]
|
||||
|
@ -689,7 +689,7 @@ is not implemented).
|
||||
[[`R`] [A possibly const qualified __callable_obj__ type or reference type thereof]]
|
||||
[[`r`] [An object convertible to `R`]]
|
||||
[[`s`] [A __sequence__ of arguments that are accepted by `r`]]
|
||||
[[`f`] [An instance of `fused<R>`]]
|
||||
[[`f`] [An instance of `fused_procedure<R>`]]
|
||||
]
|
||||
|
||||
[heading Expression Semantics]
|
||||
|
@ -17,6 +17,8 @@
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/comparison/less.hpp>
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
#include <boost/preprocessor/variadic/to_seq.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
@ -61,25 +63,28 @@
|
||||
(1)NAME_SEQ, \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER( \
|
||||
BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT(NAME, ...) \
|
||||
# define BOOST_FUSION_ADAPT_STRUCT(...) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
(0)(BOOST_PP_SEQ_HEAD(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \
|
||||
struct_tag, \
|
||||
0, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER( \
|
||||
BOOST_PP_SEQ_TAIL(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ...) \
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(...) \
|
||||
BOOST_FUSION_ADAPT_STRUCT_BASE( \
|
||||
(0), \
|
||||
(0)(NAME), \
|
||||
(0)(BOOST_PP_SEQ_HEAD(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \
|
||||
struct_tag, \
|
||||
1, \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER( \
|
||||
BOOST_PP_SEQ_TAIL(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_C)
|
||||
|
||||
#else // BOOST_PP_VARIADICS
|
||||
|
@ -49,14 +49,16 @@
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, unused, elem) \
|
||||
BOOST_PP_IF(BOOST_FUSION_PP_IS_SEQ(elem), \
|
||||
BOOST_PP_CAT( BOOST_FUSION_ADAPT_STRUCT_FILLER_0 elem ,_END), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(BOOST_FUSION_ADAPT_AUTO, \
|
||||
elem))
|
||||
BOOST_PP_IF(BOOST_PP_IS_EMPTY(elem), \
|
||||
BOOST_PP_EMPTY(), \
|
||||
BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(BOOST_FUSION_ADAPT_AUTO,elem))\
|
||||
)
|
||||
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(...) \
|
||||
# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(VA_ARGS_SEQ) \
|
||||
BOOST_PP_SEQ_PUSH_FRONT( \
|
||||
BOOST_PP_SEQ_FOR_EACH( \
|
||||
BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP, \
|
||||
unused, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)), \
|
||||
unused, VA_ARGS_SEQ), \
|
||||
(0,0))
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
@ -69,7 +69,7 @@
|
||||
ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
template<typename Seq> \
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
self_type& \
|
||||
operator=(Seq const& seq) \
|
||||
{ \
|
||||
@ -128,7 +128,7 @@
|
||||
ATTRIBUTE_TUPEL_SIZE, \
|
||||
ATTRIBUTES_SEQ) \
|
||||
\
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
NAME() \
|
||||
: BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
@ -137,7 +137,7 @@
|
||||
ATTRIBUTES_SEQ) \
|
||||
{} \
|
||||
\
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
NAME(self_type const& other_self) \
|
||||
: BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
@ -147,7 +147,7 @@
|
||||
{} \
|
||||
\
|
||||
template<typename Seq> \
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
NAME(Seq const& seq \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \
|
||||
@ -167,7 +167,7 @@
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
explicit \
|
||||
NAME(boost::call_traits< \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
@ -180,7 +180,7 @@
|
||||
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
explicit \
|
||||
NAME(typename boost::call_traits< \
|
||||
typename boost::fusion::detail::get_first_arg< \
|
||||
@ -217,7 +217,7 @@
|
||||
#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \
|
||||
TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \
|
||||
@ -245,7 +245,7 @@
|
||||
#define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \
|
||||
NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \
|
||||
\
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
1, \
|
||||
BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \
|
||||
|
@ -66,7 +66,7 @@
|
||||
#define BOOST_FUSION_IGNORE_2(ARG1, ARG2)
|
||||
|
||||
#define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
NAME(BOOST_PP_SEQ_FOR_EACH_I( \
|
||||
BOOST_FUSION_MAKE_CONST_REF_PARAM, \
|
||||
~, \
|
||||
@ -337,7 +337,7 @@
|
||||
typedef boost::mpl::int_<N> index; \
|
||||
typedef boost_fusion_detail_Seq sequence_type; \
|
||||
\
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_GPU_ENABLED \
|
||||
BOOST_FUSION_ITERATOR_NAME(NAME)(boost_fusion_detail_Seq& seq) \
|
||||
: seq_(seq) \
|
||||
BOOST_FUSION_DEFINE_ITERATOR_WKND_INIT_LIST_ENTRIES( \
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/algorithm/auxiliary/copy.hpp>
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
#include <boost/fusion/algorithm/auxiliary/move.hpp>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
|
||||
#include <utility> // for std::move
|
||||
|
||||
#if defined (BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
# pragma warning (disable: 4100) // unreferenced formal parameter
|
||||
|
@ -10,6 +10,7 @@
|
||||
#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/detail/result_of.hpp>
|
||||
#include <boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
|
@ -9,6 +9,7 @@
|
||||
#define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP
|
||||
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/fusion/support/detail/result_of.hpp>
|
||||
#include <boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/begin.hpp>
|
||||
|
@ -94,13 +94,13 @@ namespace boost { namespace fusion {
|
||||
{}
|
||||
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
|
||||
: base(seq)
|
||||
{}
|
||||
|
||||
template<typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0)
|
||||
: base(base::from_iterator(fusion::begin(seq)))
|
||||
{}
|
||||
@ -129,7 +129,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \
|
||||
(defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES))
|
||||
template <typename T0_>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
explicit deque(T0_&& t0
|
||||
, typename enable_if<is_convertible<T0_, T0> >::type* /*dummy*/ = 0
|
||||
)
|
||||
@ -140,7 +140,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
: base(std::forward<deque>(rhs))
|
||||
{}
|
||||
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>&& seq
|
||||
, typename disable_if<
|
||||
is_convertible<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>, T0>
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
#include <boost/mpl/plus.hpp>
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/mpl/print.hpp>
|
||||
|
||||
#define FUSION_VOID(z, n, _) void_
|
||||
|
||||
|
@ -73,7 +73,7 @@ namespace boost { namespace fusion
|
||||
: car(rhs.car), cdr(rhs.cdr) {}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
cons(
|
||||
Sequence const& seq
|
||||
, typename boost::enable_if<
|
||||
|
@ -60,7 +60,7 @@ namespace boost { namespace fusion
|
||||
: inherited_type(rhs) {}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
list(Sequence const& rhs
|
||||
, typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
|
||||
: inherited_type(rhs) {}
|
||||
|
@ -85,7 +85,7 @@ namespace boost { namespace fusion
|
||||
: data(rhs.data) {}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
map(Sequence const& rhs)
|
||||
: data(rhs) {}
|
||||
|
||||
|
@ -66,21 +66,21 @@ namespace boost { namespace fusion
|
||||
{}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
map(Sequence const& seq
|
||||
, typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0)
|
||||
: base_type(begin(seq), detail::map_impl_from_iterator())
|
||||
{}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
map(Sequence& seq
|
||||
, typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0)
|
||||
: base_type(begin(seq), detail::map_impl_from_iterator())
|
||||
{}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
map(Sequence&& seq
|
||||
, typename enable_if<traits::is_sequence<Sequence>>::type* /*dummy*/ = 0)
|
||||
: base_type(begin(seq), detail::map_impl_from_iterator())
|
||||
@ -93,7 +93,7 @@ namespace boost { namespace fusion
|
||||
{}
|
||||
|
||||
template <typename First, typename ...T_>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
map(First&& first, T_&&... rest)
|
||||
: base_type(BOOST_FUSION_FWD_ELEM(First, first), BOOST_FUSION_FWD_ELEM(T_, rest)...)
|
||||
{}
|
||||
|
@ -116,16 +116,6 @@ namespace boost { namespace fusion
|
||||
: vec(rhs.vec) {}
|
||||
|
||||
template <typename Sequence>
|
||||
// XXX:
|
||||
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
|
||||
FUSION_HASH if !defined(BOOST_CLANG)
|
||||
BOOST_CONSTEXPR
|
||||
FUSION_HASH endif
|
||||
#else
|
||||
#if !defined(BOOST_CLANG)
|
||||
BOOST_CONSTEXPR
|
||||
#endif
|
||||
#endif
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
vector(Sequence const& rhs,
|
||||
typename boost::enable_if<traits::is_sequence<Sequence> >::type* = 0)
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <boost/fusion/support/config.hpp>
|
||||
#include <boost/get_pointer.hpp>
|
||||
#include <boost/utility/addressof.hpp>
|
||||
#include <boost/type_traits/config.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost { namespace fusion { namespace detail
|
||||
@ -61,10 +60,16 @@ namespace boost { namespace fusion { namespace detail
|
||||
|
||||
template <typename PtrOrSmartPtr> struct non_const_pointee;
|
||||
|
||||
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
|
||||
# define BOOST_FUSION_TRAIT_DECL __cdecl
|
||||
#else
|
||||
# define BOOST_FUSION_TRAIT_DECL /**/
|
||||
#endif
|
||||
|
||||
namespace adl_barrier
|
||||
{
|
||||
using boost::get_pointer;
|
||||
void const * BOOST_TT_DECL get_pointer(...); // fallback
|
||||
void const * BOOST_FUSION_TRAIT_DECL get_pointer(...); // fallback
|
||||
|
||||
template< typename T> char const_tester(T *);
|
||||
template< typename T> long const_tester(T const *);
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <boost/fusion/sequence/intrinsic/end.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/size.hpp>
|
||||
#include <boost/fusion/sequence/comparison/enable_comparison.hpp>
|
||||
#include <boost/fusion/support/is_sequence.hpp>
|
||||
|
||||
#if defined(FUSION_DIRECT_OPERATOR_USAGE)
|
||||
#include <boost/fusion/sequence/comparison/detail/less_equal.hpp>
|
||||
@ -38,36 +37,6 @@ namespace boost { namespace fusion
|
||||
|
||||
namespace operators
|
||||
{
|
||||
#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1400)
|
||||
// Workaround for VC8.0 and VC7.1
|
||||
template <typename Seq1, typename Seq2>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline bool
|
||||
operator<=(sequence_base<Seq1> const& a, sequence_base<Seq2> const& b)
|
||||
{
|
||||
return less_equal(a.derived(), b.derived());
|
||||
}
|
||||
|
||||
template <typename Seq1, typename Seq2>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename disable_if<traits::is_native_fusion_sequence<Seq2>, bool>::type
|
||||
operator<=(sequence_base<Seq1> const& a, Seq2 const& b)
|
||||
{
|
||||
return less_equal(a.derived(), b);
|
||||
}
|
||||
|
||||
template <typename Seq1, typename Seq2>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename disable_if<traits::is_native_fusion_sequence<Seq1>, bool>::type
|
||||
operator<=(Seq1 const& a, sequence_base<Seq2> const& b)
|
||||
{
|
||||
return less_equal(a, b.derived());
|
||||
}
|
||||
|
||||
#else
|
||||
// Somehow VC8.0 and VC7.1 does not like this code
|
||||
// but barfs somewhere else.
|
||||
|
||||
template <typename Seq1, typename Seq2>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename
|
||||
@ -79,7 +48,6 @@ namespace boost { namespace fusion
|
||||
{
|
||||
return fusion::less_equal(a, b);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
using operators::operator<=;
|
||||
}}
|
||||
|
@ -20,5 +20,6 @@
|
||||
#include <boost/fusion/sequence/intrinsic/value_at.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/swap.hpp>
|
||||
|
||||
#endif
|
||||
|
@ -79,7 +79,7 @@ namespace boost { namespace fusion { namespace detail
|
||||
// - MSVC 10.0 implements iterator intrinsics; MSVC 13.0 implements LWG2408.
|
||||
#if (defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 40500) && \
|
||||
defined(BOOST_LIBSTDCXX11)) || \
|
||||
(defined(BOOST_MSVC) && (1600 <= BOOST_MSVC || BOOST_MSVC < 1900))
|
||||
(defined(BOOST_MSVC) && (1600 <= BOOST_MSVC && BOOST_MSVC < 1900))
|
||||
# define BOOST_FUSION_WORKAROUND_FOR_LWG_2408
|
||||
namespace std
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ namespace boost { namespace fusion
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <typename Second2>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
pair(Second2&& val
|
||||
, typename boost::disable_if<is_lvalue_reference<Second2> >::type* /* dummy */ = 0
|
||||
, typename boost::enable_if<is_convertible<Second2, Second> >::type* /*dummy*/ = 0
|
||||
|
@ -78,6 +78,7 @@ project
|
||||
[ run sequence/list_make.cpp : : : : ]
|
||||
[ run sequence/list_misc.cpp : : : : ]
|
||||
[ run sequence/list_mutate.cpp : : : : ]
|
||||
[ run sequence/list_nest.cpp : : : : ]
|
||||
[ run sequence/list_tie.cpp : : : : ]
|
||||
[ run sequence/list_value_at.cpp : : : : ]
|
||||
[ run sequence/deque_comparison.cpp : : : : ]
|
||||
@ -89,6 +90,7 @@ project
|
||||
[ run sequence/deque_misc.cpp : : : : ]
|
||||
[ run sequence/deque_move.cpp : : : : ]
|
||||
[ run sequence/deque_mutate.cpp : : : : ]
|
||||
[ run sequence/deque_nest.cpp : : : : ]
|
||||
[ run sequence/deque_tie.cpp : : : : ]
|
||||
[ run sequence/deque_value_at.cpp : : : : ]
|
||||
[ run sequence/front_extended_deque.cpp : : : : ]
|
||||
@ -131,6 +133,7 @@ project
|
||||
[ run sequence/vector_move.cpp : : : : ]
|
||||
[ run sequence/vector_mutate.cpp : : : : ]
|
||||
[ run sequence/vector_n.cpp : : : : ]
|
||||
[ run sequence/vector_nest.cpp : : : : ]
|
||||
[ run sequence/vector_hash.cpp : : : : ]
|
||||
[ run sequence/vector_tie.cpp : : : : ]
|
||||
[ run sequence/vector_value_at.cpp : : : : ]
|
||||
@ -184,6 +187,7 @@ project
|
||||
[ compile support/pair_map.cpp : : : : ]
|
||||
[ compile support/pair_set.cpp : : : : ]
|
||||
[ compile support/pair_vector.cpp : : : : ]
|
||||
[ compile support/pair_nest.cpp : : : : ]
|
||||
|
||||
# [ compile-fail xxx.cpp : : : : ]
|
||||
|
||||
|
@ -65,8 +65,8 @@ main()
|
||||
std::cout << pop_back(sv) << std::endl;
|
||||
|
||||
// Compile check only
|
||||
begin(pop_back(sv)) == end(sv);
|
||||
end(pop_back(sv)) == begin(sv);
|
||||
(void)(begin(pop_back(sv)) == end(sv));
|
||||
(void)(end(pop_back(sv)) == begin(sv));
|
||||
}
|
||||
|
||||
// $$$ JDG: TODO add compile fail facility $$$
|
||||
|
@ -149,6 +149,9 @@ namespace ns
|
||||
|
||||
#endif
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ADT(empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -77,6 +77,10 @@ BOOST_FUSION_ADAPT_ADT_NAMED(
|
||||
|
||||
#endif // BOOST_PP_VARIADICS
|
||||
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ADT_NAMED(empty_adt,renamed_empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -70,6 +70,9 @@ BOOST_FUSION_ADAPT_ASSOC_ADT(
|
||||
|
||||
#endif
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT(empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -52,6 +52,9 @@ BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(
|
||||
(int, int, obj.get_y(), obj.set_y(val), ns::y_member)
|
||||
)
|
||||
|
||||
class empty_adt{};
|
||||
BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED(empty_adt, renamed_empty_adt,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -71,6 +71,9 @@ namespace ns
|
||||
|
||||
#endif
|
||||
|
||||
struct empty_struct {};
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,);
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -38,6 +38,9 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
|
||||
(int, y, ns::y_member)
|
||||
)
|
||||
|
||||
struct empty_struct {};
|
||||
BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(empty_struct, renamed_empty_struct,);
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -71,6 +71,20 @@ BOOST_FUSION_ADAPT_ASSOC_TPL_ADT(
|
||||
|
||||
#endif
|
||||
|
||||
template <typename TypeToConstruct>
|
||||
class empty_adt_templated_factory {
|
||||
|
||||
TypeToConstruct operator()() {
|
||||
return TypeToConstruct();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
BOOST_FUSION_ADAPT_ASSOC_TPL_ADT(
|
||||
(TypeToConstruct),
|
||||
(empty_adt_templated_factory)(TypeToConstruct),
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -69,6 +69,20 @@ namespace ns
|
||||
)
|
||||
#endif
|
||||
|
||||
template <typename TypeToConstruct>
|
||||
struct empty_struct_templated_factory {
|
||||
|
||||
TypeToConstruct operator()() {
|
||||
return TypeToConstruct();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT(
|
||||
(TypeToConstruct),
|
||||
(empty_struct_templated_factory)(TypeToConstruct),
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -67,6 +67,17 @@ namespace ns
|
||||
foo foo_;
|
||||
int y;
|
||||
};
|
||||
|
||||
|
||||
// Testing non-constexpr compatible types
|
||||
struct employee {
|
||||
std::string name;
|
||||
std::string nickname;
|
||||
|
||||
employee(std::string name, std::string nickname)
|
||||
: name(name), nickname(nickname)
|
||||
{}
|
||||
};
|
||||
}
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
@ -96,6 +107,13 @@ namespace ns
|
||||
y
|
||||
)
|
||||
|
||||
BOOST_FUSION_ADAPT_STRUCT(
|
||||
ns::employee,
|
||||
name,
|
||||
nickname
|
||||
)
|
||||
|
||||
|
||||
#else // BOOST_PP_VARIADICS
|
||||
|
||||
BOOST_FUSION_ADAPT_STRUCT(
|
||||
@ -123,8 +141,17 @@ namespace ns
|
||||
(BOOST_FUSION_ADAPT_AUTO, y)
|
||||
)
|
||||
|
||||
BOOST_FUSION_ADAPT_STRUCT(
|
||||
ns::employee,
|
||||
(std::string, name)
|
||||
(BOOST_FUSION_ADAPT_AUTO, nickname)
|
||||
)
|
||||
|
||||
#endif
|
||||
|
||||
struct empty_struct {};
|
||||
BOOST_FUSION_ADAPT_STRUCT(empty_struct,)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
@ -224,6 +251,15 @@ main()
|
||||
BOOST_TEST(v2 >= v1);
|
||||
}
|
||||
|
||||
{
|
||||
ns::employee emp("John Doe", "jdoe");
|
||||
std::cout << at_c<0>(emp) << std::endl;
|
||||
std::cout << at_c<1>(emp) << std::endl;
|
||||
|
||||
fusion::vector<std::string, std::string> v1("John Doe", "jdoe");
|
||||
BOOST_TEST(emp == v1);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,10 @@ namespace ns
|
||||
|
||||
#endif
|
||||
|
||||
struct empty_struct {};
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED(empty_struct, renamed_empty_struct, )
|
||||
BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(empty_struct, (ns1), renamed_empty_struct1, )
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -79,6 +79,20 @@ namespace ns
|
||||
)
|
||||
#endif
|
||||
|
||||
template <typename TypeToConstruct>
|
||||
class empty_adt_templated_factory {
|
||||
|
||||
TypeToConstruct operator()() {
|
||||
return TypeToConstruct();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
BOOST_FUSION_ADAPT_TPL_ADT(
|
||||
(TypeToConstruct),
|
||||
(empty_adt_templated_factory)(TypeToConstruct),
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
@ -69,6 +69,19 @@ namespace ns
|
||||
|
||||
#endif
|
||||
|
||||
template <typename TypeToConstruct>
|
||||
struct empty_struct_templated_factory {
|
||||
|
||||
TypeToConstruct operator()() {
|
||||
return TypeToConstruct();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
BOOST_FUSION_ADAPT_TPL_STRUCT(
|
||||
(TypeToConstruct),
|
||||
(empty_struct_templated_factory)(TypeToConstruct),
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
|
@ -24,8 +24,23 @@ BOOST_FUSION_DEFINE_STRUCT(
|
||||
(int, y)
|
||||
)
|
||||
|
||||
// Tutorial (compile test only)
|
||||
BOOST_FUSION_DEFINE_STRUCT(
|
||||
(demo), employee,
|
||||
(std::string, name)
|
||||
(int, age)
|
||||
)
|
||||
|
||||
BOOST_FUSION_DEFINE_STRUCT(BOOST_PP_EMPTY(), s, (int, m))
|
||||
|
||||
// Testing non-constexpr compatible types
|
||||
BOOST_FUSION_DEFINE_STRUCT(
|
||||
(ns),
|
||||
employee,
|
||||
(std::string, name)
|
||||
(std::string, nickname)
|
||||
)
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
@ -100,6 +115,13 @@ main()
|
||||
BOOST_TEST(p == make_vector(3,5));
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
{
|
||||
ns::employee emp = make_list("John Doe", "jdoe");
|
||||
std::cout << at_c<0>(emp) << std::endl;
|
||||
std::cout << at_c<1>(emp) << std::endl;
|
||||
|
||||
BOOST_TEST(emp == make_vector("John Doe", "jdoe"));
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -41,6 +41,13 @@ namespace ns
|
||||
BOOST_FUSION_DEFINE_STRUCT_INLINE(s, (int, m))
|
||||
|
||||
BOOST_FUSION_DEFINE_STRUCT_INLINE(empty_struct, )
|
||||
|
||||
// Testing non-constexpr compatible types
|
||||
BOOST_FUSION_DEFINE_STRUCT_INLINE(
|
||||
employee,
|
||||
(std::string, name)
|
||||
(std::string, nickname)
|
||||
)
|
||||
}
|
||||
|
||||
template <typename Point>
|
||||
@ -128,6 +135,17 @@ main()
|
||||
{
|
||||
run_test<cls::point>(); // test with non-template enclosing class
|
||||
run_test<tpl_cls<>::point>(); // test with template enclosing class
|
||||
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
|
||||
ns::employee emp = make_list("John Doe", "jdoe");
|
||||
std::cout << at_c<0>(emp) << std::endl;
|
||||
std::cout << at_c<1>(emp) << std::endl;
|
||||
|
||||
BOOST_TEST(emp == make_vector("John Doe", "jdoe"));
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
|
||||
}
|
||||
|
19
test/sequence/deque_nest.cpp
Normal file
19
test/sequence/deque_nest.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
/*=============================================================================
|
||||
Copyright (C) 2015 Kohei Takahshi
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#include <boost/fusion/container/deque/deque.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE deque
|
||||
#include "nest.hpp"
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -164,9 +164,11 @@ void test()
|
||||
|
||||
BOOST_STATIC_ASSERT((is_same<boost::fusion::result_of::deref<i0>::type, int&>::value));
|
||||
BOOST_STATIC_ASSERT((is_same<boost::fusion::result_of::deref<i1>::type, char&>::value));
|
||||
BOOST_STATIC_ASSERT((is_same<boost::fusion::result_of::deref<i2>::type, char&>::value));
|
||||
|
||||
BOOST_STATIC_ASSERT((is_same<boost::fusion::result_of::value_of<i0>::type, int>::value));
|
||||
BOOST_STATIC_ASSERT((is_same<boost::fusion::result_of::value_of<i1>::type, char&>::value));
|
||||
BOOST_STATIC_ASSERT((is_same<boost::fusion::result_of::value_of<i2>::type, char&>::value));
|
||||
}
|
||||
|
||||
{ // Testing advance
|
||||
|
19
test/sequence/list_nest.cpp
Normal file
19
test/sequence/list_nest.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
/*=============================================================================
|
||||
Copyright (C) 2015 Kohei Takahshi
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#include <boost/fusion/container/list/list.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE list
|
||||
#include "nest.hpp"
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
@ -111,6 +111,7 @@ main()
|
||||
pair<int, char> a = at_c<0>(m); (void) a;
|
||||
pair<double, std::string> b = at_c<1>(m);
|
||||
pair<abstract, int> c = at_c<2>(m);
|
||||
(void)c;
|
||||
}
|
||||
|
||||
// iterators & random access interface.
|
||||
@ -154,6 +155,7 @@ main()
|
||||
// make sure that the correct constructor is called
|
||||
pair<int, copy_all> p1;
|
||||
pair<int, copy_all> p2 = p1;
|
||||
(void)p2;
|
||||
}
|
||||
|
||||
{
|
||||
|
58
test/sequence/nest.hpp
Normal file
58
test/sequence/nest.hpp
Normal file
@ -0,0 +1,58 @@
|
||||
/*=============================================================================
|
||||
Copyright (C) 2015 Kohei Takahshi
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
|
||||
#include <utility>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
template <typename C>
|
||||
void test_copy()
|
||||
{
|
||||
C src;
|
||||
C dst = src;
|
||||
(void)dst;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <typename C>
|
||||
void test_move()
|
||||
{
|
||||
C src;
|
||||
C dst = std::move(src);
|
||||
(void)dst;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename C>
|
||||
void test_all()
|
||||
{
|
||||
test_copy<C>();
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
test_move<C>();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
test()
|
||||
{
|
||||
using namespace boost::fusion;
|
||||
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<> > >();
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<>, int> >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<> > >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<>, float> >();
|
||||
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<int> > >();
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<int>, int> >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<int> > >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<int>, float> >();
|
||||
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<int, float> > >();
|
||||
test_all<FUSION_SEQUENCE<FUSION_SEQUENCE<int, float>, int> >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<int, float> > >();
|
||||
test_all<FUSION_SEQUENCE<int, FUSION_SEQUENCE<int, float>, float> >();
|
||||
}
|
||||
|
19
test/sequence/vector_nest.cpp
Normal file
19
test/sequence/vector_nest.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
/*=============================================================================
|
||||
Copyright (C) 2015 Kohei Takahshi
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
==============================================================================*/
|
||||
#include <boost/fusion/container/vector/vector.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
#define FUSION_SEQUENCE vector
|
||||
#include "nest.hpp"
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
test();
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
24
test/support/pair_nest.cpp
Normal file
24
test/support/pair_nest.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 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)
|
||||
==============================================================================*/
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/fusion/support/pair.hpp>
|
||||
|
||||
using namespace boost::fusion;
|
||||
|
||||
template <typename C>
|
||||
void copy()
|
||||
{
|
||||
pair<int, C> src;
|
||||
pair<int, C> dest = src;
|
||||
boost::ignore_unused(dest);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
copy<pair<void, float> >();
|
||||
}
|
||||
|
Reference in New Issue
Block a user