From 67f0863cddff5ea0cb0e5a91bf5d2daa6f96d21b Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sun, 22 Mar 2015 12:24:18 +0900 Subject: [PATCH 01/18] Fix includes. --- include/boost/fusion/algorithm/auxiliary.hpp | 2 ++ include/boost/fusion/algorithm/auxiliary/move.hpp | 2 ++ include/boost/fusion/sequence/intrinsic.hpp | 1 + 3 files changed, 5 insertions(+) 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/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 From 0bbea1ea32e99760f5e7057237225c0f2c33bb8a Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Wed, 1 Apr 2015 09:57:55 +0900 Subject: [PATCH 02/18] doc: Fix a typo --- doc/container.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/container.qbk b/doc/container.qbk index 7c619bda..0010e2c3 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] From 6e569bcdc34740f7137243837732183d63f65f26 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 14 Apr 2015 13:39:50 +0900 Subject: [PATCH 03/18] Fix workaround condition: || v.s. &&. see: https://github.com/boostorg/fusion/commit/01a2d6557ea65fb4c5ec6f3e50d3340c1c13629d#commitcomment-10697799 --- include/boost/fusion/support/config.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From 0fcd2aa32808ba5b5957aeaa37ba937554365dc9 Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Wed, 1 Apr 2015 15:14:56 +0200 Subject: [PATCH 04/18] doc: fix typo in documentation of fused_procedure --- doc/functional.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] From 94f53a8d4ca06f24205d49ed75dd661258f70117 Mon Sep 17 00:00:00 2001 From: Felix Gruber Date: Thu, 2 Apr 2015 15:46:37 +0200 Subject: [PATCH 05/18] fix a typo --- doc/extension.qbk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]] From 91966ae5244c6fda7ed53e6a5a0767cb3b34a65e Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Tue, 21 Apr 2015 03:45:39 +0800 Subject: [PATCH 06/18] added test case for https://svn.boost.org/trac/boost/ticket/11211 --- test/sequence/define_struct.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/sequence/define_struct.cpp b/test/sequence/define_struct.cpp index 795fdf6e..cd65ad09 100644 --- a/test/sequence/define_struct.cpp +++ b/test/sequence/define_struct.cpp @@ -24,6 +24,13 @@ 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)) int @@ -102,4 +109,3 @@ main() return boost::report_errors(); } - From bbdfc9972e855094b6b50c6ec7afb202f6704868 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 21 Apr 2015 08:59:24 +0200 Subject: [PATCH 07/18] Remove BOOST_CONSTEXPR on BOOST_FUSION_DEFINE_STRUCT constructor as it however adds the requirement that the user provided types are constant enabled. --- .../adapted/struct/detail/define_struct.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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, \ From 265de03026b3336c260df0fed75ae30ce5993425 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 26 Apr 2015 21:14:17 +0200 Subject: [PATCH 08/18] Add test cases for non-constexpr compatible types. --- test/sequence/adapt_struct.cpp | 33 ++++++++++++++++++++++++++ test/sequence/define_struct.cpp | 16 +++++++++++++ test/sequence/define_struct_inline.cpp | 18 ++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index c0cd3049..b7e4e117 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,6 +141,12 @@ namespace ns (BOOST_FUSION_ADAPT_AUTO, y) ) + BOOST_FUSION_ADAPT_STRUCT( + ns::employee, + (std::string, name), + (BOOST_FUSION_ADAPT_AUTO, nickname) + ) + #endif int @@ -224,6 +248,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/define_struct.cpp b/test/sequence/define_struct.cpp index 795fdf6e..63b5a19d 100644 --- a/test/sequence/define_struct.cpp +++ b/test/sequence/define_struct.cpp @@ -26,6 +26,14 @@ BOOST_FUSION_DEFINE_STRUCT( 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 +108,14 @@ 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(); } From ce62bb49f331a06c18f6b4f0dc92346c6aa353bb Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 26 Apr 2015 22:10:00 +0200 Subject: [PATCH 09/18] fix constructors of DEFINE_STRUCT_INLINE to allow construction with non-constexpr compatible. --- .../fusion/adapted/struct/detail/define_struct_inline.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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( \ From b902afa5a06903ac85d7f5f0b7b742a8c8f6b3bf Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 29 Apr 2015 15:58:41 +0200 Subject: [PATCH 10/18] fix testcase when BOOST_PP_VARIADICS is disabled. --- test/sequence/adapt_struct.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index b7e4e117..121827f5 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -143,7 +143,7 @@ namespace ns BOOST_FUSION_ADAPT_STRUCT( ns::employee, - (std::string, name), + (std::string, name) (BOOST_FUSION_ADAPT_AUTO, nickname) ) From 2445f6098188290c4b930ace7901044b80cf8829 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 5 May 2015 14:09:20 +0900 Subject: [PATCH 11/18] Fix #11249: missing includes. --- include/boost/fusion/algorithm/iteration/reverse_fold.hpp | 1 + include/boost/fusion/algorithm/iteration/reverse_iter_fold.hpp | 1 + 2 files changed, 2 insertions(+) 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 From 8b1da45bfe2bd13f34b1c0ae3b06af4c545a1874 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 6 May 2015 08:21:02 +0200 Subject: [PATCH 12/18] Fix 11269 (https://svn.boost.org/trac/boost/ticket/11269) and add test case for it. --- .../fusion/adapted/struct/adapt_struct.hpp | 19 ++++++++++++------- .../struct/detail/adapt_base_attr_filler.hpp | 10 ++++++---- test/sequence/adapt_struct.cpp | 3 +++ 3 files changed, 21 insertions(+), 11 deletions(-) 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/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 121827f5..37b76923 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -149,6 +149,9 @@ namespace ns #endif +struct empty_struct {}; +BOOST_FUSION_ADAPT_STRUCT(empty_struct,); + int main() { From 9911e05838000de6c8ab96c114d40e99b12111ff Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Fri, 15 May 2015 09:09:10 +0200 Subject: [PATCH 13/18] Adds test for each case adapter macros we support to adapt an empty type. --- test/sequence/adapt_adt.cpp | 3 +++ test/sequence/adapt_adt_named.cpp | 4 ++++ test/sequence/adapt_assoc_adt.cpp | 3 +++ test/sequence/adapt_assoc_adt_named.cpp | 3 +++ test/sequence/adapt_assoc_struct.cpp | 3 +++ test/sequence/adapt_assoc_struct_named.cpp | 3 +++ test/sequence/adapt_assoc_tpl_adt.cpp | 14 ++++++++++++++ test/sequence/adapt_assoc_tpl_struct.cpp | 14 ++++++++++++++ test/sequence/adapt_struct.cpp | 2 +- test/sequence/adapt_struct_named.cpp | 4 ++++ test/sequence/adapt_tpl_adt.cpp | 14 ++++++++++++++ test/sequence/adapt_tpl_struct.cpp | 13 +++++++++++++ 12 files changed, 79 insertions(+), 1 deletion(-) 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 37b76923..e4c8f6ee 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -150,7 +150,7 @@ namespace ns #endif struct empty_struct {}; -BOOST_FUSION_ADAPT_STRUCT(empty_struct,); +BOOST_FUSION_ADAPT_STRUCT(empty_struct,) int main() 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() From cac994a7c604c7c66ccfdb1961c3068750f06319 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 21 May 2015 19:14:12 +0100 Subject: [PATCH 14/18] Stop Using type_traits details. Best not to use type_traits undocumented details, these will be moving soon, and use of this header will warn loud and clear if you continue to use it. --- .../fusion/functional/invocation/detail/that_ptr.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 *); From 869513768decbaf82460372216fcec879dba4ef3 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sat, 23 May 2015 09:51:06 +0900 Subject: [PATCH 15/18] Remove obsolete workaround. now it doesn't work properly. --- .../fusion/sequence/comparison/less_equal.hpp | 32 ------------------- 1 file changed, 32 deletions(-) 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<=; }} From e0f10734b13d7e95afacf9338c2a179affb38f34 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Mon, 8 Jun 2015 11:53:17 +0900 Subject: [PATCH 16/18] Fix issue 11267. Compiler yields compile error within a function witch used in unevaluate context of constexpr function because of CWG 1581 [2]. 1. https://llvm.org/bugs/show_bug.cgi?id=23135 2. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1581 --- .../container/deque/detail/cpp03/deque.hpp | 8 +-- include/boost/fusion/container/list/cons.hpp | 2 +- include/boost/fusion/container/list/list.hpp | 2 +- .../fusion/container/map/detail/cpp03/map.hpp | 2 +- include/boost/fusion/container/map/map.hpp | 8 +-- .../boost/fusion/container/vector/vector.hpp | 10 ---- include/boost/fusion/support/pair.hpp | 2 +- test/Jamfile | 4 ++ test/sequence/deque_nest.cpp | 19 ++++++ test/sequence/list_nest.cpp | 19 ++++++ test/sequence/nest.hpp | 58 +++++++++++++++++++ test/sequence/vector_nest.cpp | 19 ++++++ test/support/pair_nest.cpp | 24 ++++++++ 13 files changed, 155 insertions(+), 22 deletions(-) create mode 100644 test/sequence/deque_nest.cpp create mode 100644 test/sequence/list_nest.cpp create mode 100644 test/sequence/nest.hpp create mode 100644 test/sequence/vector_nest.cpp create mode 100644 test/support/pair_nest.cpp 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/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/list.hpp b/include/boost/fusion/container/list/list.hpp index 5b584131..6a06ef4c 100644 --- a/include/boost/fusion/container/list/list.hpp +++ b/include/boost/fusion/container/list/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/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/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index c1cea915..234fa986 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/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/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/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/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/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 >(); +} + From ff25066be20df3c4951c86c384694854ffcf21af Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Mon, 8 Jun 2015 13:36:49 +0900 Subject: [PATCH 17/18] Remove unnecessary include of mpl::print. --- .../fusion/container/deque/detail/cpp03/deque_keyed_values.hpp | 1 - 1 file changed, 1 deletion(-) 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_ From 3521ea34173d9e26f86b82f39dcbd226478af42b Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Mon, 8 Jun 2015 21:41:54 +0900 Subject: [PATCH 18/18] Suppress warnings. --- test/algorithm/pop_back.cpp | 4 ++-- test/sequence/iterator.hpp | 2 ++ test/sequence/map.cpp | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) 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/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/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; } {