diff --git a/doc/container.qbk b/doc/container.qbk index af2b557a..8a29e29b 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -309,7 +309,7 @@ __front_extended_deque__ and __back_extended_deque__. #include #include - #include + #include #include [heading Synopsis] diff --git a/doc/extension.qbk b/doc/extension.qbk index cbb61ce5..21ebd849 100644 --- a/doc/extension.qbk +++ b/doc/extension.qbk @@ -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]] diff --git a/doc/functional.qbk b/doc/functional.qbk index 4a8e3d81..7205a0b2 100644 --- a/doc/functional.qbk +++ b/doc/functional.qbk @@ -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`]] + [[`f`] [An instance of `fused_procedure`]] ] [heading Expression Semantics] diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index e96e7c76..2744f5b2 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include #include @@ -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 diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp index 69d5b204..7a83bb34 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp @@ -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 diff --git a/include/boost/fusion/adapted/struct/detail/define_struct.hpp b/include/boost/fusion/adapted/struct/detail/define_struct.hpp index 25542920..ce3737ea 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct.hpp @@ -69,7 +69,7 @@ ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ template \ - 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 \ - 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, \ diff --git a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp index a5a3ae06..a037ffe5 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp @@ -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_ 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( \ diff --git a/include/boost/fusion/algorithm/auxiliary.hpp b/include/boost/fusion/algorithm/auxiliary.hpp index 004ae8db..313c81f8 100644 --- a/include/boost/fusion/algorithm/auxiliary.hpp +++ b/include/boost/fusion/algorithm/auxiliary.hpp @@ -9,6 +9,8 @@ #include #include +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES #include +#endif #endif diff --git a/include/boost/fusion/algorithm/auxiliary/move.hpp b/include/boost/fusion/algorithm/auxiliary/move.hpp index e20acae5..68552829 100644 --- a/include/boost/fusion/algorithm/auxiliary/move.hpp +++ b/include/boost/fusion/algorithm/auxiliary/move.hpp @@ -18,6 +18,8 @@ #include #include +#include // for std::move + #if defined (BOOST_MSVC) # pragma warning(push) # pragma warning (disable: 4100) // unreferenced formal parameter diff --git a/include/boost/fusion/algorithm/iteration/reverse_fold.hpp b/include/boost/fusion/algorithm/iteration/reverse_fold.hpp index 76e6bf25..dffff79e 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_fold.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_fold.hpp @@ -10,6 +10,7 @@ #define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_FOLD_HPP #include +#include #include #include #include diff --git a/include/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp b/include/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp index e49f8b83..d36861f3 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp @@ -9,6 +9,7 @@ #define BOOST_FUSION_ALGORITHM_ITERATION_REVERSE_ITER_FOLD_HPP #include +#include #include #include #include diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp index 7c9417e5..db8a967a 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp @@ -94,13 +94,13 @@ namespace boost { namespace fusion { {} template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED deque(deque const& seq) : base(seq) {} template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq, typename disable_if >::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 - BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 , typename enable_if >::type* /*dummy*/ = 0 ) @@ -140,7 +140,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) : base(std::forward(rhs)) {} template - BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED deque(deque&& seq , typename disable_if< is_convertible, T0> diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp index 21b49345..fcbd74a7 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values.hpp @@ -24,7 +24,6 @@ #include #include -#include #define FUSION_VOID(z, n, _) void_ diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp index 61d8dbcf..d649068a 100644 --- a/include/boost/fusion/container/list/cons.hpp +++ b/include/boost/fusion/container/list/cons.hpp @@ -73,7 +73,7 @@ namespace boost { namespace fusion : car(rhs.car), cdr(rhs.cdr) {} template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED cons( Sequence const& seq , typename boost::enable_if< diff --git a/include/boost/fusion/container/list/detail/cpp03/list.hpp b/include/boost/fusion/container/list/detail/cpp03/list.hpp index 5b584131..6a06ef4c 100644 --- a/include/boost/fusion/container/list/detail/cpp03/list.hpp +++ b/include/boost/fusion/container/list/detail/cpp03/list.hpp @@ -60,7 +60,7 @@ namespace boost { namespace fusion : inherited_type(rhs) {} template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs , typename boost::enable_if >::type* = 0) : inherited_type(rhs) {} diff --git a/include/boost/fusion/container/list/list.hpp b/include/boost/fusion/container/list/list.hpp deleted file mode 100644 index e69de29b..00000000 diff --git a/include/boost/fusion/container/map/detail/cpp03/map.hpp b/include/boost/fusion/container/map/detail/cpp03/map.hpp index e2f471b5..3ff1d05d 100644 --- a/include/boost/fusion/container/map/detail/cpp03/map.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/map.hpp @@ -85,7 +85,7 @@ namespace boost { namespace fusion : data(rhs.data) {} template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED map(Sequence const& rhs) : data(rhs) {} diff --git a/include/boost/fusion/container/map/map.hpp b/include/boost/fusion/container/map/map.hpp index f93a693f..e90d28a9 100644 --- a/include/boost/fusion/container/map/map.hpp +++ b/include/boost/fusion/container/map/map.hpp @@ -66,21 +66,21 @@ namespace boost { namespace fusion {} template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED map(Sequence const& seq , typename enable_if>::type* /*dummy*/ = 0) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED map(Sequence& seq , typename enable_if>::type* /*dummy*/ = 0) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED map(Sequence&& seq , typename enable_if>::type* /*dummy*/ = 0) : base_type(begin(seq), detail::map_impl_from_iterator()) @@ -93,7 +93,7 @@ namespace boost { namespace fusion {} template - 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)...) {} diff --git a/include/boost/fusion/container/vector/detail/cpp03/vector.hpp b/include/boost/fusion/container/vector/detail/cpp03/vector.hpp index c1cea915..234fa986 100644 --- a/include/boost/fusion/container/vector/detail/cpp03/vector.hpp +++ b/include/boost/fusion/container/vector/detail/cpp03/vector.hpp @@ -116,16 +116,6 @@ namespace boost { namespace fusion : vec(rhs.vec) {} template - // 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 >::type* = 0) diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp deleted file mode 100644 index e69de29b..00000000 diff --git a/include/boost/fusion/functional/invocation/detail/that_ptr.hpp b/include/boost/fusion/functional/invocation/detail/that_ptr.hpp index 7a1a5c57..33ee93bf 100644 --- a/include/boost/fusion/functional/invocation/detail/that_ptr.hpp +++ b/include/boost/fusion/functional/invocation/detail/that_ptr.hpp @@ -12,7 +12,6 @@ #include #include #include -#include #include namespace boost { namespace fusion { namespace detail @@ -61,10 +60,16 @@ namespace boost { namespace fusion { namespace detail template struct non_const_pointee; - namespace adl_barrier +#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 *); diff --git a/include/boost/fusion/sequence/comparison/less_equal.hpp b/include/boost/fusion/sequence/comparison/less_equal.hpp index 53159926..c5dfa8d5 100644 --- a/include/boost/fusion/sequence/comparison/less_equal.hpp +++ b/include/boost/fusion/sequence/comparison/less_equal.hpp @@ -13,7 +13,6 @@ #include #include #include -#include #if defined(FUSION_DIRECT_OPERATOR_USAGE) #include @@ -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 - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - inline bool - operator<=(sequence_base const& a, sequence_base const& b) - { - return less_equal(a.derived(), b.derived()); - } - - template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - inline typename disable_if, bool>::type - operator<=(sequence_base const& a, Seq2 const& b) - { - return less_equal(a.derived(), b); - } - - template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - inline typename disable_if, bool>::type - operator<=(Seq1 const& a, sequence_base 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 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<=; }} diff --git a/include/boost/fusion/sequence/intrinsic.hpp b/include/boost/fusion/sequence/intrinsic.hpp index 45838074..d3e5af0b 100644 --- a/include/boost/fusion/sequence/intrinsic.hpp +++ b/include/boost/fusion/sequence/intrinsic.hpp @@ -20,5 +20,6 @@ #include #include #include +#include #endif diff --git a/include/boost/fusion/support/config.hpp b/include/boost/fusion/support/config.hpp index 62bbe96c..1ce042a8 100644 --- a/include/boost/fusion/support/config.hpp +++ b/include/boost/fusion/support/config.hpp @@ -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 { diff --git a/include/boost/fusion/support/pair.hpp b/include/boost/fusion/support/pair.hpp index fd5d57e6..a4cd1ff0 100644 --- a/include/boost/fusion/support/pair.hpp +++ b/include/boost/fusion/support/pair.hpp @@ -49,7 +49,7 @@ namespace boost { namespace fusion #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_FUSION_GPU_ENABLED pair(Second2&& val , typename boost::disable_if >::type* /* dummy */ = 0 , typename boost::enable_if >::type* /*dummy*/ = 0 diff --git a/test/Jamfile b/test/Jamfile index 752a798a..a21303eb 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -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 : : : : ] diff --git a/test/algorithm/pop_back.cpp b/test/algorithm/pop_back.cpp index b594f6c8..5e45e779 100644 --- a/test/algorithm/pop_back.cpp +++ b/test/algorithm/pop_back.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 $$$ diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index 265cfca5..bf5d4ca0 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -149,6 +149,9 @@ namespace ns #endif +class empty_adt{}; +BOOST_FUSION_ADAPT_ADT(empty_adt,) + int main() { diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index 8924ce41..f7e115aa 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -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() { diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index a03605f1..fca3941d 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -70,6 +70,9 @@ BOOST_FUSION_ADAPT_ASSOC_ADT( #endif +class empty_adt{}; +BOOST_FUSION_ADAPT_ASSOC_ADT(empty_adt,) + int main() { diff --git a/test/sequence/adapt_assoc_adt_named.cpp b/test/sequence/adapt_assoc_adt_named.cpp index 8ef9aa27..d685528d 100644 --- a/test/sequence/adapt_assoc_adt_named.cpp +++ b/test/sequence/adapt_assoc_adt_named.cpp @@ -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() { diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index 4cdabb87..6bb4a8ee 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -71,6 +71,9 @@ namespace ns #endif +struct empty_struct {}; +BOOST_FUSION_ADAPT_ASSOC_STRUCT(empty_struct,); + int main() { diff --git a/test/sequence/adapt_assoc_struct_named.cpp b/test/sequence/adapt_assoc_struct_named.cpp index f24dadd9..fd7fdc50 100644 --- a/test/sequence/adapt_assoc_struct_named.cpp +++ b/test/sequence/adapt_assoc_struct_named.cpp @@ -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() { diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index 8aa600ff..e0b89dca 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -71,6 +71,20 @@ BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( #endif +template +class empty_adt_templated_factory { + + TypeToConstruct operator()() { + return TypeToConstruct(); + } + +}; + +BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( + (TypeToConstruct), + (empty_adt_templated_factory)(TypeToConstruct), +) + int main() { diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index 6adcc931..a949dad0 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -69,6 +69,20 @@ namespace ns ) #endif +template +struct empty_struct_templated_factory { + + TypeToConstruct operator()() { + return TypeToConstruct(); + } + +}; + +BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( + (TypeToConstruct), + (empty_struct_templated_factory)(TypeToConstruct), +) + int main() { diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index c0cd3049..e4c8f6ee 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -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 v1("John Doe", "jdoe"); + BOOST_TEST(emp == v1); + } + return boost::report_errors(); } diff --git a/test/sequence/adapt_struct_named.cpp b/test/sequence/adapt_struct_named.cpp index aab11d2d..63fc3f5f 100644 --- a/test/sequence/adapt_struct_named.cpp +++ b/test/sequence/adapt_struct_named.cpp @@ -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() { diff --git a/test/sequence/adapt_tpl_adt.cpp b/test/sequence/adapt_tpl_adt.cpp index bbd1d07f..c454baa5 100644 --- a/test/sequence/adapt_tpl_adt.cpp +++ b/test/sequence/adapt_tpl_adt.cpp @@ -79,6 +79,20 @@ namespace ns ) #endif +template +class empty_adt_templated_factory { + + TypeToConstruct operator()() { + return TypeToConstruct(); + } + +}; + +BOOST_FUSION_ADAPT_TPL_ADT( + (TypeToConstruct), + (empty_adt_templated_factory)(TypeToConstruct), +) + int main() { diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index 86face6d..861bab65 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -69,6 +69,19 @@ namespace ns #endif +template +struct empty_struct_templated_factory { + + TypeToConstruct operator()() { + return TypeToConstruct(); + } + +}; + +BOOST_FUSION_ADAPT_TPL_STRUCT( + (TypeToConstruct), + (empty_struct_templated_factory)(TypeToConstruct), +) int main() diff --git a/test/sequence/define_struct.cpp b/test/sequence/define_struct.cpp index 795fdf6e..d91dda95 100644 --- a/test/sequence/define_struct.cpp +++ b/test/sequence/define_struct.cpp @@ -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)); } + { + 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(); } - diff --git a/test/sequence/define_struct_inline.cpp b/test/sequence/define_struct_inline.cpp index e849ce9b..d34a142b 100644 --- a/test/sequence/define_struct_inline.cpp +++ b/test/sequence/define_struct_inline.cpp @@ -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 @@ -128,6 +135,17 @@ main() { run_test(); // test with non-template enclosing class run_test::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(); } diff --git a/test/sequence/deque_nest.cpp b/test/sequence/deque_nest.cpp new file mode 100644 index 00000000..6f70ee9a --- /dev/null +++ b/test/sequence/deque_nest.cpp @@ -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 +#include + +#define FUSION_SEQUENCE deque +#include "nest.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/iterator.hpp b/test/sequence/iterator.hpp index d9ef5e0f..d543f8eb 100644 --- a/test/sequence/iterator.hpp +++ b/test/sequence/iterator.hpp @@ -164,9 +164,11 @@ void test() BOOST_STATIC_ASSERT((is_same::type, int&>::value)); BOOST_STATIC_ASSERT((is_same::type, char&>::value)); + BOOST_STATIC_ASSERT((is_same::type, char&>::value)); BOOST_STATIC_ASSERT((is_same::type, int>::value)); BOOST_STATIC_ASSERT((is_same::type, char&>::value)); + BOOST_STATIC_ASSERT((is_same::type, char&>::value)); } { // Testing advance diff --git a/test/sequence/list_nest.cpp b/test/sequence/list_nest.cpp new file mode 100644 index 00000000..ff97b807 --- /dev/null +++ b/test/sequence/list_nest.cpp @@ -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 +#include + +#define FUSION_SEQUENCE list +#include "nest.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/map.cpp b/test/sequence/map.cpp index 8dada167..5a130f8b 100644 --- a/test/sequence/map.cpp +++ b/test/sequence/map.cpp @@ -111,6 +111,7 @@ main() pair a = at_c<0>(m); (void) a; pair b = at_c<1>(m); pair 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 p1; pair p2 = p1; + (void)p2; } { diff --git a/test/sequence/nest.hpp b/test/sequence/nest.hpp new file mode 100644 index 00000000..e8087320 --- /dev/null +++ b/test/sequence/nest.hpp @@ -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 +#include + +template +void test_copy() +{ + C src; + C dst = src; + (void)dst; +} + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) +template +void test_move() +{ + C src; + C dst = std::move(src); + (void)dst; +} +#endif + +template +void test_all() +{ + test_copy(); +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + test_move(); +#endif +} + +void +test() +{ + using namespace boost::fusion; + + test_all > >(); + test_all, int> >(); + test_all > >(); + test_all, float> >(); + + test_all > >(); + test_all, int> >(); + test_all > >(); + test_all, float> >(); + + test_all > >(); + test_all, int> >(); + test_all > >(); + test_all, float> >(); +} + diff --git a/test/sequence/vector_nest.cpp b/test/sequence/vector_nest.cpp new file mode 100644 index 00000000..a0cb76c6 --- /dev/null +++ b/test/sequence/vector_nest.cpp @@ -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 +#include + +#define FUSION_SEQUENCE vector +#include "nest.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/support/pair_nest.cpp b/test/support/pair_nest.cpp new file mode 100644 index 00000000..fbc253cb --- /dev/null +++ b/test/support/pair_nest.cpp @@ -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 +#include + +using namespace boost::fusion; + +template +void copy() +{ + pair src; + pair dest = src; + boost::ignore_unused(dest); +} + +int main() +{ + copy >(); +} +