From 3f965e00d30ea050218608c682a51d54db5eb156 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 22 Dec 2013 21:14:31 +0100 Subject: [PATCH 01/85] #9516 BOOST_FUSION_AUTO_ADAPT_STRUCT that does not require specifying the types of the fields. --- .../adapted/struct/auto_adapt_struct.hpp | 28 +++ test/Jamfile | 1 + test/sequence/auto_adapt_struct.cpp | 164 ++++++++++++++++++ 3 files changed, 193 insertions(+) create mode 100644 include/boost/fusion/adapted/struct/auto_adapt_struct.hpp create mode 100644 test/sequence/auto_adapt_struct.cpp diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp new file mode 100644 index 00000000..9029ecbe --- /dev/null +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2009-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_STRUCT_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_STRUCT_HPP + +#include + +#include + +#include + +#define BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER(r, data, elem) \ + (BOOST_TYPEOF(data::elem), elem) \ + +#define BOOST_FUSION_AUTO_ADAPT_STRUCT(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT(NAME, \ + BOOST_PP_SEQ_FOR_EACH( \ + BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, NAME, ATTRIBUTES) \ + ) + +#endif diff --git a/test/Jamfile b/test/Jamfile index 1c84637d..1e58b054 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -141,6 +141,7 @@ project [ run sequence/adapt_assoc_tpl_struct.cpp : : : : ] [ run sequence/adapt_struct_named.cpp : : : : ] [ run sequence/adapt_struct.cpp : : : : ] + [ run sequence/auto_adapt_struct.cpp : : : : ] [ run sequence/adapt_tpl_adt.cpp : : : : ] [ run sequence/adapt_tpl_struct.cpp : : : : ] [ run sequence/adt_attribute_proxy.cpp : : : : ] diff --git a/test/sequence/auto_adapt_struct.cpp b/test/sequence/auto_adapt_struct.cpp new file mode 100644 index 00000000..7007e49c --- /dev/null +++ b/test/sequence/auto_adapt_struct.cpp @@ -0,0 +1,164 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2013-2014 Damien Buhl + + 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ns +{ + struct point + { + int x; + int y; + }; + +#if !BOOST_WORKAROUND(__GNUC__,<4) + struct point_with_private_attributes + { + friend struct boost::fusion::extension::access; + + private: + int x; + int y; + + public: + point_with_private_attributes(int x, int y):x(x),y(y) + {} + }; +#endif +} + +BOOST_FUSION_AUTO_ADAPT_STRUCT( + ns::point, + (x) + (y) +) + +#if !BOOST_WORKAROUND(__GNUC__,<4) +BOOST_FUSION_AUTO_ADAPT_STRUCT( + ns::point_with_private_attributes, + (x) + (y) +) +#endif + +struct s { int m; }; +BOOST_FUSION_AUTO_ADAPT_STRUCT(s, (m)) + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view)); + ns::point p = {123, 456}; + + std::cout << at_c<0>(p) << std::endl; + std::cout << at_c<1>(p) << std::endl; + std::cout << p << std::endl; + BOOST_TEST(p == make_vector(123, 456)); + + at_c<0>(p) = 6; + at_c<1>(p) = 9; + BOOST_TEST(p == make_vector(6, 9)); + + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + fusion::vector v1(4, 2); + ns::point v2 = {5, 3}; + fusion::vector v3(5, 4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + } + + { + // conversion from ns::point to vector + ns::point p = {5, 3}; + fusion::vector v(p); + v = p; + } + + { + // conversion from ns::point to list + ns::point p = {5, 3}; + fusion::list l(p); + l = p; + } + + { // begin/end + using namespace boost::fusion; + using boost::is_same; + + typedef boost::fusion::result_of::begin::type b; + typedef boost::fusion::result_of::end::type e; + // this fails + BOOST_MPL_ASSERT((is_same::type, e>)); + } + + { + BOOST_MPL_ASSERT((mpl::is_sequence)); + BOOST_MPL_ASSERT((boost::is_same< + boost::fusion::result_of::value_at_c::type + , mpl::front::type>)); + } + +#if !BOOST_WORKAROUND(__GNUC__,<4) + { + ns::point_with_private_attributes p(123, 456); + + std::cout << at_c<0>(p) << std::endl; + std::cout << at_c<1>(p) << std::endl; + std::cout << p << std::endl; + BOOST_TEST(p == make_vector(123, 456)); + } +#endif + + return boost::report_errors(); +} From 946957d3dccfc8cf5125cc19d2578638309e79f4 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 26 Jan 2014 14:44:15 +0100 Subject: [PATCH 02/85] EDITORIAL: Change parameter names for consistency. --- include/boost/fusion/adapted/struct/auto_adapt_struct.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp index 9029ecbe..d71e39de 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp @@ -16,8 +16,8 @@ #include -#define BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER(r, data, elem) \ - (BOOST_TYPEOF(data::elem), elem) \ +#define BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER(r, NAME, ATTRIBUTE) \ + (BOOST_TYPEOF(NAME::ATTRIBUTE), ATTRIBUTE) \ #define BOOST_FUSION_AUTO_ADAPT_STRUCT(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT(NAME, \ From 0d7ad9f6e28443ea54a76ea20af8474472345f47 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 26 Jan 2014 17:31:01 +0100 Subject: [PATCH 03/85] FEATURE: BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED that does not require specifying the types of the fields. --- include/boost/fusion/adapted/struct.hpp | 2 + .../struct/auto_adapt_struct_named.hpp | 25 ++++ test/Jamfile | 1 + test/sequence/auto_adapt_struct_named.cpp | 137 ++++++++++++++++++ 4 files changed, 165 insertions(+) create mode 100644 include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp create mode 100644 test/sequence/auto_adapt_struct_named.cpp diff --git a/include/boost/fusion/adapted/struct.hpp b/include/boost/fusion/adapted/struct.hpp index 3f159038..5a45b596 100644 --- a/include/boost/fusion/adapted/struct.hpp +++ b/include/boost/fusion/adapted/struct.hpp @@ -14,7 +14,9 @@ #include #include #include +#include #include +#include #include #include #include diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp new file mode 100644 index 00000000..a09662b7 --- /dev/null +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2009-2010 Hartmut Kaiser + Copyright (c) 2010-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl + + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_STRUCT_NAMED_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_STRUCT_NAMED_HPP + +#include +#include + +#define BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_NAMED( \ + WRAPPED_TYPE,NAME, \ + BOOST_PP_SEQ_FOR_EACH( \ + BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, WRAPPED_TYPE, ATTRIBUTES) \ + ) + +#endif diff --git a/test/Jamfile b/test/Jamfile index 1e58b054..c5bfdf6a 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -140,6 +140,7 @@ project [ run sequence/adapt_assoc_tpl_adt.cpp : : : : ] [ run sequence/adapt_assoc_tpl_struct.cpp : : : : ] [ run sequence/adapt_struct_named.cpp : : : : ] + [ run sequence/auto_adapt_struct_named.cpp : : : : ] [ run sequence/adapt_struct.cpp : : : : ] [ run sequence/auto_adapt_struct.cpp : : : : ] [ run sequence/adapt_tpl_adt.cpp : : : : ] diff --git a/test/sequence/auto_adapt_struct_named.cpp b/test/sequence/auto_adapt_struct_named.cpp new file mode 100644 index 00000000..dfa10006 --- /dev/null +++ b/test/sequence/auto_adapt_struct_named.cpp @@ -0,0 +1,137 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ns +{ + struct point + { + int x; + int y; + }; +} + +// this creates a fusion view: boost::fusion::adapted::point +BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED( + ns::point, point, + (x) + (y) +) + +// this creates a fusion view: ns1::s1 +struct s { int m; }; +BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (int, m)) + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT((traits::is_view)); + ns::point basep = {123, 456}; + adapted::point p(basep); + + std::cout << at_c<0>(p) << std::endl; + std::cout << at_c<1>(p) << std::endl; + std::cout << p << std::endl; + BOOST_TEST(p == make_vector(123, 456)); + + at_c<0>(p) = 6; + at_c<1>(p) = 9; + BOOST_TEST(p == make_vector(6, 9)); + + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + fusion::vector v1(4, 2); + ns::point p = {5, 3}; + adapted::point v2(p); + + fusion::vector v3(5, 4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + } + + { + // conversion from adapted::point to vector + ns::point basep = {5, 3}; + adapted::point p(basep); + fusion::vector v(p); + v = p; + } + + { + // conversion from adapted::point to list + ns::point basep = {5, 3}; + adapted::point p(basep); + fusion::list l(p); + l = p; + } + + { // begin/end + using namespace boost::fusion; + using boost::is_same; + + typedef boost::fusion::result_of::begin::type b; + typedef boost::fusion::result_of::end::type e; + // this fails + BOOST_MPL_ASSERT((is_same::type, e>)); + } + + + { + BOOST_MPL_ASSERT((mpl::is_sequence)); + BOOST_MPL_ASSERT((boost::is_same< + boost::fusion::result_of::value_at_c::type + , mpl::front::type>)); + } + + return boost::report_errors(); +} + From 5aa9a89fb82cd29f8a48d3dba41df9573d81c3cf Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 26 Jan 2014 18:01:44 +0100 Subject: [PATCH 04/85] FEATURE: BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS which allows listing class attributes to adapt without specifying types. --- .../fusion/adapted/struct/auto_adapt_struct_named.hpp | 8 ++++++++ test/sequence/auto_adapt_struct_named.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp index a09662b7..81b58cf6 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp @@ -15,6 +15,14 @@ #include #include +#define BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, \ + BOOST_PP_SEQ_FOR_EACH( \ + BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, WRAPPED_TYPE, ATTRIBUTES)) \ + #define BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_NAMED( \ WRAPPED_TYPE,NAME, \ diff --git a/test/sequence/auto_adapt_struct_named.cpp b/test/sequence/auto_adapt_struct_named.cpp index dfa10006..1ada8efe 100644 --- a/test/sequence/auto_adapt_struct_named.cpp +++ b/test/sequence/auto_adapt_struct_named.cpp @@ -49,7 +49,7 @@ BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED( // this creates a fusion view: ns1::s1 struct s { int m; }; -BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (int, m)) +BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (m)) int main() From e58bd91f277b6ea38b2a062ddeb7414064c92ed0 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 26 Jan 2014 18:02:00 +0100 Subject: [PATCH 05/85] EDITORIAL: fixed indentation. --- include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp index 81b58cf6..e414304b 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp @@ -27,7 +27,7 @@ BOOST_FUSION_ADAPT_STRUCT_NAMED( \ WRAPPED_TYPE,NAME, \ BOOST_PP_SEQ_FOR_EACH( \ - BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, WRAPPED_TYPE, ATTRIBUTES) \ + BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, WRAPPED_TYPE, ATTRIBUTES) \ ) #endif From 5ffab5001e54cc50325505445dc7a94ebddc895b Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 26 Jan 2014 18:23:00 +0100 Subject: [PATCH 06/85] REFACTORING: reused the BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS macro in BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED to mimic the non-AUTO versions. --- .../fusion/adapted/struct/auto_adapt_struct_named.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp index e414304b..a7fd6923 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp @@ -24,10 +24,7 @@ BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, WRAPPED_TYPE, ATTRIBUTES)) \ #define BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_NAMED( \ - WRAPPED_TYPE,NAME, \ - BOOST_PP_SEQ_FOR_EACH( \ - BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, WRAPPED_TYPE, ATTRIBUTES) \ - ) + BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) #endif From 8a132ea44a641ba30b3fb29a18f70b2b4f9d707f Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 4 Feb 2014 22:48:34 +0100 Subject: [PATCH 07/85] BUGFIX: Fix include path. --- include/boost/fusion/adapted/struct/auto_adapt_struct.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp index d71e39de..c049de1e 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp @@ -14,7 +14,7 @@ #include -#include +#include #define BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER(r, NAME, ATTRIBUTE) \ (BOOST_TYPEOF(NAME::ATTRIBUTE), ATTRIBUTE) \ From f7b14aee35cbf25a7728eb8b334c2ad8df893c8d Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 11 Feb 2014 23:37:53 +0100 Subject: [PATCH 08/85] FEATURE: BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT now allows defining a Random Access Sequence and an Associative sequence without providing the type. --- .../struct/auto_adapt_assoc_struct.hpp | 44 ++++++ test/Jamfile | 1 + test/sequence/auto_adapt_assoc_struct.cpp | 141 ++++++++++++++++++ 3 files changed, 186 insertions(+) create mode 100644 include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp create mode 100644 test/sequence/auto_adapt_assoc_struct.cpp diff --git a/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp new file mode 100644 index 00000000..0b069de1 --- /dev/null +++ b/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2007 Dan Marsden + Copyright (c) 2009-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_ASSOC_STRUCT_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_ASSOC_STRUCT_HPP + +#include +#include + +#include + +#include +#include + +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_0(A, B) \ + ((A, B)) BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_1 +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_1(A, B) \ + ((A, B)) BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_0 +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_0_END +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_1_END + +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_TYPE_DEDUCER(r, NAME, ATTRIBUTE) \ + (BOOST_TYPEOF(NAME::BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)), \ + BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE), \ + BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)) + +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT(NAME, \ + BOOST_PP_SEQ_FOR_EACH( \ + BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_TYPE_DEDUCER, \ + NAME, \ + BOOST_PP_CAT( \ + BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END) \ + ) \ + ) + +#endif diff --git a/test/Jamfile b/test/Jamfile index c5bfdf6a..f21f753d 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -137,6 +137,7 @@ project [ run sequence/adapt_assoc_adt.cpp : : : : ] [ run sequence/adapt_assoc_struct_named.cpp : : : : ] [ run sequence/adapt_assoc_struct.cpp : : : : ] + [ run sequence/auto_adapt_assoc_struct.cpp : : : : ] [ run sequence/adapt_assoc_tpl_adt.cpp : : : : ] [ run sequence/adapt_assoc_tpl_struct.cpp : : : : ] [ run sequence/adapt_struct_named.cpp : : : : ] diff --git a/test/sequence/auto_adapt_assoc_struct.cpp b/test/sequence/auto_adapt_assoc_struct.cpp new file mode 100644 index 00000000..177df20b --- /dev/null +++ b/test/sequence/auto_adapt_assoc_struct.cpp @@ -0,0 +1,141 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2005-2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ns +{ + struct x_member; + struct y_member; + struct z_member; + + struct point + { + int x; + int y; + }; +} + +BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT( + ns::point, + (x, ns::x_member) + (y, ns::y_member) +) + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view)); + ns::point p = {123, 456}; + + std::cout << at_c<0>(p) << std::endl; + std::cout << at_c<1>(p) << std::endl; + std::cout << p << std::endl; + BOOST_TEST(p == make_vector(123, 456)); + + at_c<0>(p) = 6; + at_c<1>(p) = 9; + BOOST_TEST(p == make_vector(6, 9)); + + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + fusion::vector v1(4, 2); + ns::point v2 = {5, 3}; + fusion::vector v3(5, 4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + } + + { + // conversion from ns::point to vector + ns::point p = {5, 3}; + fusion::vector v(p); + v = p; + } + + { + // conversion from ns::point to list + ns::point p = {5, 3}; + fusion::list l(p); + l = p; + } + + { + // assoc stuff + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((mpl::not_ >)); + + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + + ns::point p = {5, 3}; + + BOOST_TEST(at_key(p) == 5); + BOOST_TEST(at_key(p) == 3); + } + + { + BOOST_MPL_ASSERT((mpl::is_sequence)); + BOOST_MPL_ASSERT((boost::is_same< + boost::fusion::result_of::value_at_c::type + , mpl::front::type>)); + } + + return boost::report_errors(); +} + From 2d37b9c22ce311887210813ec4538fe272014cab Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 11 Feb 2014 23:39:42 +0100 Subject: [PATCH 09/85] EDITORIAL: Fixes typos. --- include/boost/fusion/adapted/struct/auto_adapt_struct.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp index c049de1e..b967be06 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp @@ -17,12 +17,12 @@ #include #define BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER(r, NAME, ATTRIBUTE) \ - (BOOST_TYPEOF(NAME::ATTRIBUTE), ATTRIBUTE) \ + (BOOST_TYPEOF(NAME::ATTRIBUTE), ATTRIBUTE) #define BOOST_FUSION_AUTO_ADAPT_STRUCT(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT(NAME, \ BOOST_PP_SEQ_FOR_EACH( \ - BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, NAME, ATTRIBUTES) \ + BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, NAME, ATTRIBUTES) \ ) #endif From a5f87696f2aef03156aaefffc923afc33f483e3f Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 11 Feb 2014 23:46:38 +0100 Subject: [PATCH 10/85] EDITORIAL: Rename the macro for type deduction to a more expressive and correct name. --- include/boost/fusion/adapted/struct/auto_adapt_struct.hpp | 4 ++-- .../boost/fusion/adapted/struct/auto_adapt_struct_named.hpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp index b967be06..08f47157 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp @@ -16,13 +16,13 @@ #include -#define BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER(r, NAME, ATTRIBUTE) \ +#define BOOST_FUSION_AUTO_ADAPT_STRUCT_TYPE_DEDUCER(r, NAME, ATTRIBUTE) \ (BOOST_TYPEOF(NAME::ATTRIBUTE), ATTRIBUTE) #define BOOST_FUSION_AUTO_ADAPT_STRUCT(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT(NAME, \ BOOST_PP_SEQ_FOR_EACH( \ - BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, NAME, ATTRIBUTES) \ + BOOST_FUSION_AUTO_ADAPT_STRUCT_TYPE_DEDUCER, NAME, ATTRIBUTES) \ ) #endif diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp index a7fd6923..de81fbcf 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp @@ -21,7 +21,9 @@ BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ WRAPPED_TYPE, NAMESPACE_SEQ, NAME, \ BOOST_PP_SEQ_FOR_EACH( \ - BOOST_FUSION_AUTO_ADAPT_STRUCT_FILLER, WRAPPED_TYPE, ATTRIBUTES)) \ + BOOST_FUSION_AUTO_ADAPT_STRUCT_TYPE_DEDUCER, \ + WRAPPED_TYPE, \ + ATTRIBUTES)) #define BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS( \ From 934463c7b4001b932f8a69f72edbc28f168d58ef Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 18 Feb 2014 22:04:38 +0100 Subject: [PATCH 11/85] FEATURE: BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED now allows defining a Random Access Sequence and an Associative sequence without providing the type. --- .../struct/auto_adapt_assoc_struct_named.hpp | 56 ++++++++ test/Jamfile | 1 + .../auto_adapt_assoc_struct_named.cpp | 121 ++++++++++++++++++ 3 files changed, 178 insertions(+) create mode 100644 include/boost/fusion/adapted/struct/auto_adapt_assoc_struct_named.hpp create mode 100644 test/sequence/auto_adapt_assoc_struct_named.cpp diff --git a/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct_named.hpp b/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct_named.hpp new file mode 100644 index 00000000..1945c62c --- /dev/null +++ b/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct_named.hpp @@ -0,0 +1,56 @@ +/*============================================================================= + Copyright (c) 2010-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_ASSOC_STRUCT_NAMED_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_ASSOC_STRUCT_NAMED_HPP + +#include +#include +#include + +#include + +#include + +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0(A, B) \ + ((A, B)) BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1 +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1(A, B) \ + ((A, B)) BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0_END +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1_END + +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_TYPE_DEDUCER( \ + r, NAME, ATTRIBUTE) \ + (BOOST_TYPEOF( \ + BOOST_PP_TUPLE_ELEM( \ + 2, \ + 0, \ + NAME) \ + ::BOOST_PP_TUPLE_ELEM( \ + 2, \ + 0, \ + ATTRIBUTE)), \ + BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE), \ + BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)) + +#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED( \ + WRAPPED_TYPE, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, \ + NAME, \ + BOOST_PP_SEQ_FOR_EACH( \ + BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_TYPE_DEDUCER, \ + (WRAPPED_TYPE, NAME), \ + BOOST_PP_CAT( \ + BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 ATTRIBUTES, \ + _END) \ + ) \ + ) + + +#endif diff --git a/test/Jamfile b/test/Jamfile index f21f753d..5587ab5d 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -136,6 +136,7 @@ project [ run sequence/adapt_assoc_adt_named.cpp : : : : ] [ run sequence/adapt_assoc_adt.cpp : : : : ] [ run sequence/adapt_assoc_struct_named.cpp : : : : ] + [ run sequence/auto_adapt_assoc_struct_named.cpp : : : : ] [ run sequence/adapt_assoc_struct.cpp : : : : ] [ run sequence/auto_adapt_assoc_struct.cpp : : : : ] [ run sequence/adapt_assoc_tpl_adt.cpp : : : : ] diff --git a/test/sequence/auto_adapt_assoc_struct_named.cpp b/test/sequence/auto_adapt_assoc_struct_named.cpp new file mode 100644 index 00000000..b2e85541 --- /dev/null +++ b/test/sequence/auto_adapt_assoc_struct_named.cpp @@ -0,0 +1,121 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ns +{ + struct x_member; + struct y_member; + struct z_member; + + struct point + { + int x; + int y; + }; +} + +BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED( + ns::point, + point, + (x, ns::x_member) + (y, ns::y_member) +) + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT((traits::is_view)); + ns::point basep = {123, 456}; + adapted::point p(basep); + + std::cout << at_c<0>(p) << std::endl; + std::cout << at_c<1>(p) << std::endl; + std::cout << p << std::endl; + BOOST_TEST(p == make_vector(123, 456)); + + at_c<0>(p) = 6; + at_c<1>(p) = 9; + BOOST_TEST(p == make_vector(6, 9)); + + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + vector v1(4, 2); + ns::point basev2 = {5, 3}; + adapted::point v2(basev2); + + vector v3(5, 4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + } + + { + // conversion from adapted::point to vector + ns::point basep = {5, 3}; + adapted::point p(basep); + vector v(p); + v = p; + } + + { + // conversion from adapted::point to list + ns::point basep = {5, 3}; + adapted::point p(basep); + list l(p); + l = p; + } + + { + // assoc stuff + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); + + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + + ns::point basep = {5, 3}; + adapted::point p(basep); + + BOOST_TEST(at_key(p) == 5); + BOOST_TEST(at_key(p) == 3); + } + + return boost::report_errors(); +} + From 435fb5c29fa9093dd37b238a1ccb00cd5b74992d Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 18 Feb 2014 22:04:51 +0100 Subject: [PATCH 12/85] EDITORIAL: Reorganize imports. --- include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp index 0b069de1..936e1e74 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp @@ -13,11 +13,11 @@ #include #include +#include #include #include -#include #define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_0(A, B) \ ((A, B)) BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_1 From 166132789a59debcbad224c6ef014b875ae5da17 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 4 Mar 2014 23:22:23 +0100 Subject: [PATCH 13/85] DOC: Document the BOOST_FUSION_AUTO* macros. This documents the AUTO_ADAPT macros : * BOOST_FUSION_AUTO_ADAPT_STRUCT * BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED * BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT * BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED --- doc/adapted.qbk | 172 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 159 insertions(+), 13 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index f762a049..2f77a0c6 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -177,7 +177,7 @@ __boost_tuple_library__ [endsect] -[section:adapt_struct BOOST_FUSION_ADAPT_STRUCT] +[section:adapt_struct BOOST_FUSION_ \[AUTO_\] ADAPT_STRUCT] [heading Description] BOOST_FUSION_ADAPT_STRUCT is a macro that can be used to generate all the @@ -192,13 +192,22 @@ __random_access_sequence__. ... ) + BOOST_FUSION_AUTO_ADAPT_STRUCT( + struct_name, + (member_name0) + (member_name1) + ... + ) + [heading Semantics] The above macro generates the necessary code to adapt `struct_name` as a model of __random_access_sequence__. The sequence of `(member_typeN, member_nameN)` pairs declares the type and names of each of the struct members that are -part of the sequence. +part of the sequence. While the auto version of the macro only allows +specifying a sequence of `(member_nameN)` as fields' types are deduced with +[@boost:/libs/typeof/index.html Boost.TypeOf]. The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -206,9 +215,10 @@ namespace qualified name of the struct to be adapted. [heading Header] #include + #include #include -[heading Example] +[heading Example: BOOST_FUSION_ADAPT_STRUCT ] namespace demo { struct employee @@ -224,6 +234,23 @@ namespace qualified name of the struct to be adapted. (std::string, name) (int, age)) + +[heading Example: BOOST_FUSION_AUTO_ADAPT_STRUCT ] + namespace demo + { + struct employee + { + std::string name; + int age; + }; + } + + // demo::employee is now a Fusion sequence + BOOST_FUSION_AUTO_ADAPT_STRUCT( + demo::employee, + (name) + (age)) + [endsect] [section:adapt_tpl_struct BOOST_FUSION_ADAPT_TPL_STRUCT] @@ -284,7 +311,7 @@ namespace qualified name of the struct to be adapted. [endsect] -[section:adapt_struct_named BOOST_FUSION_ADAPT_STRUCT_NAMED] +[section:adapt_struct_named BOOST_FUSION_ \[AUTO_\] ADAPT_STRUCT_NAMED] [heading Description] BOOST_FUSION_ADAPT_STRUCT_NAMED and BOOST_FUSION_ADAPT_STRUCT_NAMED_NS are @@ -292,6 +319,7 @@ macros that can be used to generate all the necessary boilerplate to make an arbitrary struct a model of __random_access_sequence__. The given struct is adapted using the given name. + [heading Synopsis] BOOST_FUSION_ADAPT_STRUCT_NAMED( struct_name, adapted_name, @@ -300,6 +328,13 @@ adapted using the given name. ... ) + BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED( + struct_name, adapted_name, + (member_name0) + (member_name1) + ... + ) + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( struct_name, (namespace0)(namespace1)..., @@ -309,6 +344,17 @@ adapted using the given name. ... ) + BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS( + struct_name, + (namespace0)(namespace1)..., + adapted_name, + (member_name0) + (member_name1) + ... + ) + + + [heading Semantics] The above macros generate the necessary code to adapt `struct_name` @@ -321,9 +367,11 @@ If an empty namespace sequence is given (that is a macro that expands to nothing), the adapted view is placed in the global namespace. If no namespace sequence is given (i.e. `BOOST_FUSION_ADAPT_STRUCT_NAMED`), the adapted view is placed in the namespace `boost::fusion::adapted`. -The sequence of `(member_typeN, member_nameN)` -pairs declares the type and names of each of the struct members that are -part of the sequence. +In the non-auto version of the macro the sequence of +`(member_typeN, member_nameN)` pairs declares the type and names of each of the +struct members that are part of the sequence. +While the auto version of the macro only allows specifying a sequence of +`(member_nameN)` as fields' types are deduced with [@boost:/libs/typeof/index.html Boost.TypeOf]. The macros should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be converted. @@ -331,9 +379,10 @@ namespace qualified name of the struct to be converted. [heading Header] #include + #include #include -[heading Example] +[heading Example: BOOST_FUSION_ADAPT_STRUCT_NAMED] namespace demo { struct employee @@ -350,9 +399,26 @@ namespace qualified name of the struct to be converted. (std::string, name) (int, age)) +[heading Example: BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED] + namespace demo + { + struct employee + { + std::string name; + int age; + }; + } + + // boost::fusion::adapted::adapted_employee is now a Fusion sequence + // referring to demo::employee + BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED( + demo::employee, adapted_employee, + (name) + (age)) + [endsect] -[section:adapt_assoc BOOST_FUSION_ADAPT_ASSOC_STRUCT] +[section:adapt_assoc BOOST_FUSION_ \[AUTO_\] ADAPT_ASSOC_STRUCT] [heading Description] BOOST_FUSION_ADAPT_ASSOC_STRUCT is a macro that can be used to generate all the @@ -367,13 +433,24 @@ __random_access_sequence__ and __associative_sequence__. ... ) + BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT( + struct_name, + (member_name0, key_type0) + (member_name1, key_type1) + ... + ) + [heading Semantics] The above macro generates the necessary code to adapt `struct_name` as a model of __random_access_sequence__ and __associative_sequence__. The sequence of `(member_typeN, member_nameN, key_typeN)` triples declares the type, name and key type of each of the struct members -that are part of the sequence. +that are part of the sequence. + +While BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT only allows specifying a sequence of +`(member_nameN, key_typeN)` as fields' types are deduced with +[@boost:/libs/typeof/index.html Boost.TypeOf]. The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -381,9 +458,10 @@ namespace qualified name of the struct to be adapted. [heading Header] #include + #include #include -[heading Example] +[heading Example : BOOST_FUSION_ADAPT_ASSOC_STRUCT] namespace demo { struct employee @@ -407,6 +485,30 @@ namespace qualified name of the struct to be adapted. (std::string, name, keys::name) (int, age, keys::age)) +[heading Example : BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT] + namespace demo + { + struct employee + { + std::string name; + int age; + }; + } + + namespace keys + { + struct name; + struct age; + } + + // demo::employee is now a Fusion sequence. + // It is also an associative sequence with + // keys keys::name and keys::age present. + BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT( + demo::employee, + (name, keys::name) + (age, keys::age)) + [endsect] [section:adapt_assoc_tpl_struct BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT] @@ -475,7 +577,7 @@ namespace qualified name of the struct to be adapted. [endsect] -[section:adapt_assoc_struct_named BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED] +[section:adapt_assoc_struct_named BOOST_FUSION_ \[AUTO_\] ADAPT_ASSOC_STRUCT_NAMED] [heading Description] BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED and BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS are @@ -491,6 +593,13 @@ __associative_sequence__. The given struct is adapted using the given name. ... ) + BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED( + struct_name, adapted_name, + (member_name0, key_type0) + (member_name1, key_type1) + ... + ) + BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( struct_name, (namespace0)(namespace1)..., @@ -500,6 +609,15 @@ __associative_sequence__. The given struct is adapted using the given name. ... ) + BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_NS( + struct_name, + (namespace0)(namespace1)..., + adapted_name, + (member_name0, key_type0) + (member_name1, key_type1) + ... + ) + [heading Semantics] The above macros generate the necessary code to adapt `struct_name` @@ -516,15 +634,20 @@ The sequence of `(member_typeN, member_nameN, key_typeN)` triples declares the type, name and key type of each of the struct members that are part of the sequence. +While BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED only allows specifying a +sequence of `(member_nameN, key_typeN)` as fields' types are deduced with +[@boost:/libs/typeof/index.html Boost.TypeOf]. + The macros should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be converted. [heading Header] #include + #include #include -[heading Example] +[heading Example : BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED] namespace demo { struct employee @@ -547,6 +670,29 @@ namespace qualified name of the struct to be converted. (std::string, name, keys::name) (int, age, keys::age)) +[heading Example : BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED] + namespace demo + { + struct employee + { + std::string name; + int age; + }; + } + + namespace keys + { + struct name; + struct age; + } + + // boost::fusion::adapted::adapted_employee is now a Fusion sequence + // referring to demo::employee + BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED( + demo::employee, adapted_employee, + (name, keys::name) + (age, keys::age)) + [endsect] [section:adapt_adt BOOST_FUSION_ADAPT_ADT] From c052b4b452f101b9c1aa48acfe45e1aa7f483468 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 18 Mar 2014 23:33:10 +0100 Subject: [PATCH 14/85] FEATURE: Making BOOST_FUSION_AUTO_ADAPT_STRUCT variadic. --- .../adapted/struct/auto_adapt_struct.hpp | 30 ++++++++++++++++++- test/sequence/auto_adapt_struct.cpp | 7 ++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp index 08f47157..96e82999 100644 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp @@ -11,6 +11,9 @@ #define BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_STRUCT_HPP #include +#include +#include +#include #include @@ -19,10 +22,35 @@ #define BOOST_FUSION_AUTO_ADAPT_STRUCT_TYPE_DEDUCER(r, NAME, ATTRIBUTE) \ (BOOST_TYPEOF(NAME::ATTRIBUTE), ATTRIBUTE) -#define BOOST_FUSION_AUTO_ADAPT_STRUCT(NAME, ATTRIBUTES) \ +#define BOOST_FUSION_AUTO_ADAPT_STRUCT(...) \ + BOOST_FUSION_AUTO_ADAPT_STRUCT_BASE( \ + BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__), \ + BOOST_PP_SEQ_POP_FRONT(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))) + +#define BOOST_FUSION_AUTO_ADAPT_STRUCT_BASE(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT(NAME, \ BOOST_PP_SEQ_FOR_EACH( \ BOOST_FUSION_AUTO_ADAPT_STRUCT_TYPE_DEDUCER, NAME, ATTRIBUTES) \ ) + + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ + ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_1 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ + ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_0 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END + +#define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 0, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_STRUCT_C) + + + #endif diff --git a/test/sequence/auto_adapt_struct.cpp b/test/sequence/auto_adapt_struct.cpp index 7007e49c..e7ce2890 100644 --- a/test/sequence/auto_adapt_struct.cpp +++ b/test/sequence/auto_adapt_struct.cpp @@ -57,10 +57,15 @@ namespace ns #endif } -BOOST_FUSION_AUTO_ADAPT_STRUCT( +/*BOOST_FUSION_AUTO_ADAPT_STRUCT( ns::point, (x) (y) +)*/ + +BOOST_FUSION_AUTO_ADAPT_STRUCT( + ns::point, + x, y ) #if !BOOST_WORKAROUND(__GNUC__,<4) From 3ca94f57626b16123fd0abe4865953a49beb988b Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 7 May 2014 08:57:28 +0200 Subject: [PATCH 15/85] DOC: Add some comments to help me understand the adapt macros. --- .../adapted/struct/detail/adapt_base.hpp | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index db702ae1..29c1a288 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -118,7 +118,7 @@ > \ { \ typedef \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ //TODO: DAM Typeof can be added here attribute_type; \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ @@ -167,6 +167,24 @@ } \ }; +/** + * \brief Creates a Random Access Sequence for the struct/class named NAME_SEQ + * \param TEMPLATE_PARAMS_SEQ + * \param NAME_SEQ Sequence of a boolean telling if the type is a template type + * or not, followed by the name of the type to be adapted. + * + * That is (0)(mystruct) means adaptation of mystruct a + * non-template type. While (1)(my_tpl_struct) means adaptation + * of a template based struct. + * \param TAG The tag of the Random Access Sequence, this enables to select the + * implementation of the sequence. + * \param IS_VIEW Whether if this creates a sequence of a view from a sequence + * \param ATTRIBUTES_SEQ Sequence of struct attributes to add to the list of + * adapted elements + * \param ATTRIBUTES_CALLBACK Macro callback used to register the attributes into + * the sequence. Usually a call to + * BOOST_FUSION_ADAPT_STRUCT_C_BASE. + */ #define BOOST_FUSION_ADAPT_STRUCT_BASE( \ TEMPLATE_PARAMS_SEQ, \ NAME_SEQ, \ From 7e1c6cdf479fa81bc4b39ad79ebda97a04d1d198 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Fri, 9 May 2014 13:25:38 +0200 Subject: [PATCH 16/85] FEATURE: Type deduction for BOOST_FUSION_ADAPT_STRUCT_C_BASE, with preliminary support for providing or deducing the type. --- .../fusion/adapted/struct/adapt_struct.hpp | 41 +++++++++++++++++++ .../adapted/struct/detail/adapt_base.hpp | 18 +++++++- test/sequence/adapt_struct.cpp | 14 +++---- 3 files changed, 64 insertions(+), 9 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index f60ca03e..cb117781 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -6,12 +6,16 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ +#define BOOST_PP_VARIADICS 1 + #ifndef BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP #define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP #include #include #include +#include +#include #include #include #include @@ -41,6 +45,15 @@ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE,2) +#define BOOST_FUSION_ADAPT_STRUCT_C_AUTO(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \ + BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + I, \ + BOOST_PP_EMPTY, \ + ATTRIBUTE, \ + 1) + #define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (1)TEMPLATE_PARAMS_SEQ, \ @@ -60,6 +73,34 @@ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ BOOST_FUSION_ADAPT_STRUCT_C) + + + + + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0(...) \ + ((__VA_ARGS__)) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1(...) \ + ((__VA_ARGS__)) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0_END +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1_END + + +#define BOOST_FUSION_ADAPT_STRUCT_NEWAPI(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 0, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0(0,0)ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_STRUCT_C_AUTO) + + + + + + + #define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (0), \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 29c1a288..344da922 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -31,6 +31,9 @@ #include #include +#include + + #define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \ BOOST_PP_SEQ_HEAD(SEQ) \ BOOST_PP_EMPTY() @@ -55,6 +58,13 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \ BOOST_PP_TUPLE_EAT(1))(SEQ) +#define BOOST_FUSION_ATTRIBUTE_TYPE_DEDUCE(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE)\ + BOOST_TYPEOF(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)::BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ + ) + +#define BOOST_FUSION_GET_GIVEN_TYPE(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) + #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS # define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ @@ -118,7 +128,9 @@ > \ { \ typedef \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ //TODO: DAM Typeof can be added here + BOOST_PP_IF(BOOST_PP_LESS(/*ATTRIBUTE_TUPEL_SIZE*/1,2), \ + BOOST_FUSION_ATTRIBUTE_TYPE_DEDUCE, BOOST_FUSION_GET_GIVEN_TYPE \ + )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ attribute_type; \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ @@ -143,7 +155,9 @@ call(Seq& seq) \ { \ return seq.PREFIX() \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + BOOST_PP_IF(BOOST_PP_LESS(ATTRIBUTE_TUPEL_SIZE,2), 0, 1),\ + ATTRIBUTE); \ } \ }; \ }; \ diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 68240463..1faa7bc3 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -56,22 +56,22 @@ namespace ns #endif } -BOOST_FUSION_ADAPT_STRUCT( +BOOST_FUSION_ADAPT_STRUCT_NEWAPI( ns::point, - (int, x) - (int, y) + (x) + (y) ) #if !BOOST_WORKAROUND(__GNUC__,<4) -BOOST_FUSION_ADAPT_STRUCT( +BOOST_FUSION_ADAPT_STRUCT_NEWAPI( ns::point_with_private_attributes, - (int, x) - (int, y) + (x) + (y) ) #endif struct s { int m; }; -BOOST_FUSION_ADAPT_STRUCT(s, (int, m)) +BOOST_FUSION_ADAPT_STRUCT_NEWAPI(s, (m)) int main() From 703bff4ff9e2402d0b0160c8e11115c0e6c055ee Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Fri, 9 May 2014 13:59:49 +0200 Subject: [PATCH 17/85] FEATURE: Types of a struct can freely pe provided or deduced, following the user preferences. --- include/boost/fusion/adapted/struct/adapt_struct.hpp | 8 ++++---- include/boost/fusion/adapted/struct/detail/adapt_base.hpp | 2 +- test/sequence/adapt_struct.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index cb117781..e4cc3d6c 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -51,8 +51,8 @@ NAME_SEQ, \ I, \ BOOST_PP_EMPTY, \ - ATTRIBUTE, \ - 1) + BOOST_PP_TUPLE_ELEM(1, ATTRIBUTE), \ + BOOST_PP_TUPLE_ELEM(0, ATTRIBUTE)) #define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ @@ -79,9 +79,9 @@ #define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0(...) \ - ((__VA_ARGS__)) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1 + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1(...) \ - ((__VA_ARGS__)) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0 + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0_END #define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1_END diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 344da922..700c3dea 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -128,7 +128,7 @@ > \ { \ typedef \ - BOOST_PP_IF(BOOST_PP_LESS(/*ATTRIBUTE_TUPEL_SIZE*/1,2), \ + BOOST_PP_IF(BOOST_PP_LESS(ATTRIBUTE_TUPEL_SIZE,2), \ BOOST_FUSION_ATTRIBUTE_TYPE_DEDUCE, BOOST_FUSION_GET_GIVEN_TYPE \ )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ attribute_type; \ diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 1faa7bc3..65d2c4b2 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -59,7 +59,7 @@ namespace ns BOOST_FUSION_ADAPT_STRUCT_NEWAPI( ns::point, (x) - (y) + (int, y) ) #if !BOOST_WORKAROUND(__GNUC__,<4) From 04cbf0d4c651a2b8fb6bae5235a04cffc9a93247 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Fri, 9 May 2014 14:06:15 +0200 Subject: [PATCH 18/85] BUGFIX: Presents the correct field name as a string even if type is deduced. --- include/boost/fusion/adapted/struct/detail/adapt_base.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 700c3dea..ff83da0d 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -177,7 +177,9 @@ call() \ { \ return BOOST_PP_STRINGIZE( \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)); \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + BOOST_PP_IF(BOOST_PP_LESS(ATTRIBUTE_TUPEL_SIZE,2), 0, 1),\ + ATTRIBUTE)); \ } \ }; From 6f6bfb3a27d0061d1f8180c1b865692ee9f83228 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 14 May 2014 00:02:52 +0200 Subject: [PATCH 19/85] EDITORIAL: Cleaning the ADAPT_STRUCT which can deduce types. --- .../fusion/adapted/struct/adapt_struct.hpp | 52 +++++-------------- test/sequence/adapt_struct.cpp | 10 ++-- 2 files changed, 19 insertions(+), 43 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index e4cc3d6c..2633350a 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -41,17 +41,21 @@ #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END +//TODO: DAM remove need for variadic macros. +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0_END +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1_END + #define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE,2) - -#define BOOST_FUSION_ADAPT_STRUCT_C_AUTO(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \ - BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ, \ - NAME_SEQ, \ - I, \ - BOOST_PP_EMPTY, \ - BOOST_PP_TUPLE_ELEM(1, ATTRIBUTE), \ + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + I, \ + BOOST_PP_EMPTY, \ + BOOST_PP_TUPLE_ELEM(1, ATTRIBUTE), \ BOOST_PP_TUPLE_ELEM(0, ATTRIBUTE)) #define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \ @@ -65,41 +69,13 @@ BOOST_FUSION_ADAPT_STRUCT_C) #define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (0), \ - (0)(NAME), \ - struct_tag, \ - 0, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ - BOOST_FUSION_ADAPT_STRUCT_C) - - - - - - -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0(...) \ - ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1(...) \ - ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0_END -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1_END - - -#define BOOST_FUSION_ADAPT_STRUCT_NEWAPI(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (0), \ (0)(NAME), \ struct_tag, \ 0, \ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0(0,0)ATTRIBUTES,_END), \ - BOOST_FUSION_ADAPT_STRUCT_C_AUTO) - - - - - - + BOOST_FUSION_ADAPT_STRUCT_C) #define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 65d2c4b2..f2da12f7 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -56,22 +56,22 @@ namespace ns #endif } -BOOST_FUSION_ADAPT_STRUCT_NEWAPI( +BOOST_FUSION_ADAPT_STRUCT( ns::point, (x) (int, y) ) #if !BOOST_WORKAROUND(__GNUC__,<4) -BOOST_FUSION_ADAPT_STRUCT_NEWAPI( +BOOST_FUSION_ADAPT_STRUCT( ns::point_with_private_attributes, - (x) - (y) + (int, x) + (int, y) ) #endif struct s { int m; }; -BOOST_FUSION_ADAPT_STRUCT_NEWAPI(s, (m)) +BOOST_FUSION_ADAPT_STRUCT(s, (m)) int main() From 944c363787ff4c6addae07656c47c330962aca03 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 27 May 2014 22:48:19 +0200 Subject: [PATCH 20/85] Remove dependency to variadics macros for the old API not deducing types. --- .../fusion/adapted/struct/adapt_struct.hpp | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 2633350a..bf5655a9 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -6,16 +6,16 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#define BOOST_PP_VARIADICS 1 +//#define BOOST_PP_VARIADICS #ifndef BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP #define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP #include + #include #include -#include -#include +#include #include #include #include @@ -34,20 +34,29 @@ #include #include -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ - ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_1 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ - ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_0 +//TODO: Write a variadic version full : with variadic also directly to provide the fields. +#if BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_1 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0 + #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END -//TODO: DAM remove need for variadic macros. -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0(...) \ - ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1(...) \ - ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0_END -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__1_END +#else + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ + ((2, (X, Y))) BOOST_FUSION_ADAPT_STRUCT_FILLER_1 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ + ((2, (X, Y))) BOOST_FUSION_ADAPT_STRUCT_FILLER_0 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END + +#endif #define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ @@ -55,8 +64,8 @@ NAME_SEQ, \ I, \ BOOST_PP_EMPTY, \ - BOOST_PP_TUPLE_ELEM(1, ATTRIBUTE), \ - BOOST_PP_TUPLE_ELEM(0, ATTRIBUTE)) + BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE), \ + BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)) #define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ @@ -74,7 +83,7 @@ (0)(NAME), \ struct_tag, \ 0, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_NEWAPI__0(0,0)ATTRIBUTES,_END), \ + BOOST_PP_CAT( BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ BOOST_FUSION_ADAPT_STRUCT_C) #define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \ From 37fc1443adc247fddec82f2521db37d737f8010f Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Fri, 30 May 2014 17:44:49 +0200 Subject: [PATCH 21/85] Improve the BOOST_FUSION_ADAPT_STRUCT macro to work also when there is no variadic support. This enable the following flexible macro signature when there is no BOOST_PP_VARIADICS support: BOOST_FUSION_ADAPT_STRUCT( struct_name, (member_type0, member_name0) (BOOST_FUSION_ADAPT_AUTO, member_name1) (,member_name2) ... ) If BOOST_PP_VARIADICS is active then there is quite more flexibility as it allows to avoid the type specification: BOOST_FUSION_ADAPT_STRUCT( struct_name, (member_type0, member_name0) (BOOST_FUSION_ADAPT_AUTO, member_name1) (,member_name2) (member_name3) ... ) --- .../fusion/adapted/struct/adapt_struct.hpp | 43 ++++++++++++++----- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index bf5655a9..06927e9e 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -6,16 +6,17 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -//#define BOOST_PP_VARIADICS - #ifndef BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP #define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP #include - +#include +#include #include #include -#include +#include +#include +#include #include #include #include @@ -34,29 +35,49 @@ #include #include -//TODO: Write a variadic version full : with variadic also directly to provide the fields. #if BOOST_PP_VARIADICS +#define BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(...) \ + BOOST_PP_IF(BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 2), \ + BOOST_PP_IF(BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ + ((1, (BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__)) )), \ + ((2, BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__))) \ + ), \ + ((1, (BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)) )) \ + ) + #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(...) \ - ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) \ + BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(__VA_ARGS__) \ BOOST_FUSION_ADAPT_STRUCT_FILLER_1 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(...) \ - ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) \ + BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(__VA_ARGS__) \ BOOST_FUSION_ADAPT_STRUCT_FILLER_0 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END -#else +#else // BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(X, Y) \ + BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ + ((1, (Y))), \ + ((2, (X,Y))) \ + ) #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ - ((2, (X, Y))) BOOST_FUSION_ADAPT_STRUCT_FILLER_1 + BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_1 + #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ - ((2, (X, Y))) BOOST_FUSION_ADAPT_STRUCT_FILLER_0 + BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0 + #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END -#endif +#endif // BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() #define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ From 02b776360ae1b69eda9745ede2c07e6a7187c6b1 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 4 Jun 2014 01:36:15 +0200 Subject: [PATCH 22/85] FEATURE: BOOST_FUSION_ADAPT_STRUCT can now also be called completely with variadics arguments. The following signature is possible : BOOST_FUSION_ADAPT_STRUCT( struct_name, member_name0, (BOOST_FUSION_ADAPT_AUTO, member_name1) (member_type2, member_name2) member_name3, ... ) --- .../fusion/adapted/struct/adapt_struct.hpp | 30 ++++++++++++++ .../struct/detail/preprocessor/is_seq.hpp | 41 +++++++++++++++++++ test/sequence/adapt_struct.cpp | 30 ++++++++------ 3 files changed, 88 insertions(+), 13 deletions(-) create mode 100644 include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 06927e9e..bc2c56e4 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -12,6 +12,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -34,6 +37,7 @@ #include #include #include +#include #if BOOST_PP_VARIADICS @@ -98,6 +102,30 @@ BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ BOOST_FUSION_ADAPT_STRUCT_C) + +#if BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_STRUCT_PROCESS_PARAM(r, data, 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_CREATE_MEMBER_TUPLE(elem) \ + ) + +#define BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE_FROM_VARIADICS(...) \ + BOOST_PP_SEQ_PUSH_FRONT( \ + BOOST_PP_SEQ_FOR_EACH(BOOST_FUSION_ADAPT_STRUCT_PROCESS_PARAM, unused, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)), (0,0)) + +#define BOOST_FUSION_ADAPT_STRUCT(NAME, ...) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 0, \ + BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE_FROM_VARIADICS(__VA_ARGS__), \ + BOOST_FUSION_ADAPT_STRUCT_C) + +#else // BOOST_PP_VARIADICS + #define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (0), \ @@ -107,6 +135,8 @@ BOOST_PP_CAT( BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ BOOST_FUSION_ADAPT_STRUCT_C) +#endif // BOOST_PP_VARIADICS + #define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (0), \ diff --git a/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp b/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp new file mode 100644 index 00000000..95f11050 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/preprocessor/is_seq.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + BOOST_PP_VARIADICS version of BOOST_PP_IS_SEQ inspired from + boost/mpl/aux_/preprocessor/is_seq.hpp, original copyrights goes to : + + Copyright Paul Mensonides 2003 + Copyright Aleksey Gurtovoy 2003-2004 + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_PREPROCESSOR_IS_SEQ_HPP + +#include +#include +#include +#include +#include + +#if BOOST_PP_VARIADICS + +#define BOOST_FUSION_PP_IS_SEQ(seq) BOOST_PP_CAT(BOOST_FUSION_PP_IS_SEQ_, \ + BOOST_FUSION_PP_IS_SEQ_0 seq BOOST_PP_RPAREN()) + +#define BOOST_FUSION_PP_IS_SEQ_0(...) \ + BOOST_FUSION_PP_IS_SEQ_1(__VA_ARGS__ + +#define BOOST_FUSION_PP_IS_SEQ_ALWAYS_0(...) \ + 0 + +#define BOOST_FUSION_PP_IS_SEQ_BOOST_FUSION_PP_IS_SEQ_0 \ + BOOST_FUSION_PP_IS_SEQ_ALWAYS_0( + +#define BOOST_FUSION_PP_IS_SEQ_BOOST_FUSION_PP_IS_SEQ_1(...) \ + 1 + +#endif // BOOST_PP_VARIADICS + +#endif diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index f2da12f7..ca1770a4 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -4,6 +4,8 @@ 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) ==============================================================================*/ +#define BOOST_PP_VARIADICS 1 + #include #include #include @@ -38,6 +40,7 @@ namespace ns { int x; int y; + int z; }; #if !BOOST_WORKAROUND(__GNUC__,<4) @@ -58,8 +61,9 @@ namespace ns BOOST_FUSION_ADAPT_STRUCT( ns::point, - (x) - (int, y) + (int, x) + (int, y), + z ) #if !BOOST_WORKAROUND(__GNUC__,<4) @@ -71,7 +75,7 @@ BOOST_FUSION_ADAPT_STRUCT( #endif struct s { int m; }; -BOOST_FUSION_ADAPT_STRUCT(s, (m)) +BOOST_FUSION_ADAPT_STRUCT(s, (int, m)) int main() @@ -90,13 +94,13 @@ main() std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 4)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); @@ -104,9 +108,9 @@ main() } { - fusion::vector v1(4, 2); - ns::point v2 = {5, 3}; - fusion::vector v3(5, 4); + fusion::vector v1(4, 2, 3); + ns::point v2 = {5, 3, 2}; + fusion::vector v3(5, 4, 2); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -119,15 +123,15 @@ main() { // conversion from ns::point to vector - ns::point p = {5, 3}; - fusion::vector v(p); + ns::point p = {5, 3, 4}; + fusion::vector v(p); v = p; } { // conversion from ns::point to list - ns::point p = {5, 3}; - fusion::list l(p); + ns::point p = {5, 3, 4}; + fusion::list l(p); l = p; } From 7ef202b79430bb2f91f58adb59c585415a3bb66a Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 10 Jun 2014 22:15:08 +0200 Subject: [PATCH 23/85] Moved BOOST_FUSION_ADAPT_STRUCT implementation details to detail/adapt_base.hpp --- .../fusion/adapted/struct/adapt_struct.hpp | 90 ++++--------------- .../adapted/struct/auto_adapt_struct.hpp | 56 ------------ .../adapted/struct/detail/adapt_base.hpp | 72 ++++++++++----- 3 files changed, 71 insertions(+), 147 deletions(-) delete mode 100644 include/boost/fusion/adapted/struct/auto_adapt_struct.hpp diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index bc2c56e4..a5688e0d 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -1,6 +1,7 @@ /*============================================================================= Copyright (c) 2001-2007 Joel de Guzman Copyright (c) 2009-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl 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) @@ -17,8 +18,6 @@ #include #include #include -#include -#include #include #include #include @@ -37,49 +36,6 @@ #include #include #include -#include - -#if BOOST_PP_VARIADICS - -#define BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(...) \ - BOOST_PP_IF(BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 2), \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ - ((1, (BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__)) )), \ - ((2, BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__))) \ - ), \ - ((1, (BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)) )) \ - ) - -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(...) \ - BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(__VA_ARGS__) \ - BOOST_FUSION_ADAPT_STRUCT_FILLER_1 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(...) \ - BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(__VA_ARGS__) \ - BOOST_FUSION_ADAPT_STRUCT_FILLER_0 - -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END - -#else // BOOST_PP_VARIADICS - -#define BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(X, Y) \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ - ((1, (Y))), \ - ((2, (X,Y))) \ - ) - -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ - BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(X,Y) \ - BOOST_FUSION_ADAPT_STRUCT_FILLER_1 - -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ - BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE(X,Y) \ - BOOST_FUSION_ADAPT_STRUCT_FILLER_0 - -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END - -#endif // BOOST_PP_VARIADICS #define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() @@ -105,35 +61,27 @@ #if BOOST_PP_VARIADICS -#define BOOST_FUSION_ADAPT_STRUCT_PROCESS_PARAM(r, data, 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_CREATE_MEMBER_TUPLE(elem) \ - ) - -#define BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE_FROM_VARIADICS(...) \ - BOOST_PP_SEQ_PUSH_FRONT( \ - BOOST_PP_SEQ_FOR_EACH(BOOST_FUSION_ADAPT_STRUCT_PROCESS_PARAM, unused, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__)), (0,0)) - -#define BOOST_FUSION_ADAPT_STRUCT(NAME, ...) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (0), \ - (0)(NAME), \ - struct_tag, \ - 0, \ - BOOST_FUSION_ADAPT_STRUCT_CREATE_MEMBER_TUPLE_FROM_VARIADICS(__VA_ARGS__), \ - BOOST_FUSION_ADAPT_STRUCT_C) +# define BOOST_FUSION_ADAPT_STRUCT(NAME, ...) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 0, \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \ + BOOST_FUSION_ADAPT_STRUCT_C) #else // BOOST_PP_VARIADICS -#define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (0), \ - (0)(NAME), \ - struct_tag, \ - 0, \ - BOOST_PP_CAT( BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ - BOOST_FUSION_ADAPT_STRUCT_C) +# define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 0, \ + BOOST_PP_CAT( \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES, \ + _END), \ + BOOST_FUSION_ADAPT_STRUCT_C) #endif // BOOST_PP_VARIADICS diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp deleted file mode 100644 index 96e82999..00000000 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2007 Joel de Guzman - Copyright (c) 2009-2011 Christopher Schmidt - Copyright (c) 2013-2014 Damien Buhl - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ - -#ifndef BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_STRUCT_HPP -#define BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_STRUCT_HPP - -#include -#include -#include -#include - -#include - -#include - -#define BOOST_FUSION_AUTO_ADAPT_STRUCT_TYPE_DEDUCER(r, NAME, ATTRIBUTE) \ - (BOOST_TYPEOF(NAME::ATTRIBUTE), ATTRIBUTE) - -#define BOOST_FUSION_AUTO_ADAPT_STRUCT(...) \ - BOOST_FUSION_AUTO_ADAPT_STRUCT_BASE( \ - BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__), \ - BOOST_PP_SEQ_POP_FRONT(BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))) - -#define BOOST_FUSION_AUTO_ADAPT_STRUCT_BASE(NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT(NAME, \ - BOOST_PP_SEQ_FOR_EACH( \ - BOOST_FUSION_AUTO_ADAPT_STRUCT_TYPE_DEDUCER, NAME, ATTRIBUTES) \ - ) - - - -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ - ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_1 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ - ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_0 -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END - -#define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (0), \ - (0)(NAME), \ - struct_tag, \ - 0, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ - BOOST_FUSION_ADAPT_STRUCT_C) - - - -#endif diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index ff83da0d..ee3c5ff2 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -2,6 +2,7 @@ Copyright (c) 2001-2009 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden Copyright (c) 2009-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl 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) @@ -13,6 +14,7 @@ #include #include #include +#include #include #include @@ -25,14 +27,14 @@ #include #include #include +#include #include #include #include #include #include -#include - +#include #define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \ BOOST_PP_SEQ_HEAD(SEQ) \ @@ -183,24 +185,54 @@ } \ }; -/** - * \brief Creates a Random Access Sequence for the struct/class named NAME_SEQ - * \param TEMPLATE_PARAMS_SEQ - * \param NAME_SEQ Sequence of a boolean telling if the type is a template type - * or not, followed by the name of the type to be adapted. - * - * That is (0)(mystruct) means adaptation of mystruct a - * non-template type. While (1)(my_tpl_struct) means adaptation - * of a template based struct. - * \param TAG The tag of the Random Access Sequence, this enables to select the - * implementation of the sequence. - * \param IS_VIEW Whether if this creates a sequence of a view from a sequence - * \param ATTRIBUTES_SEQ Sequence of struct attributes to add to the list of - * adapted elements - * \param ATTRIBUTES_CALLBACK Macro callback used to register the attributes into - * the sequence. Usually a call to - * BOOST_FUSION_ADAPT_STRUCT_C_BASE. - */ +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_1 + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0 + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END + +#if BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(...) \ + BOOST_PP_IF(BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 2), \ + BOOST_PP_IF( \ + BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ + ((1, (BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__)) )), \ + ((2, BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__)))), \ + ((1, (BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)) ))) + +# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, data, 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_ATTRIBUTE_FILLER(elem) \ + ) + +# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(...) \ + 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__)), \ + (0,0) \ + ) + +#else // BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X, Y) \ + BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ + ((1, (Y))), \ + ((2, (X,Y))) \ + ) + + + +#endif // BOOST_PP_VARIADICS + + #define BOOST_FUSION_ADAPT_STRUCT_BASE( \ TEMPLATE_PARAMS_SEQ, \ NAME_SEQ, \ From 557b3d2dc694f73b4d58791af67d8b1c608a2ae2 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 10 Jun 2014 23:45:43 +0200 Subject: [PATCH 24/85] Fix detection of member_type parameter emptiness for BOOST_FUSION_ADAPT_STRUCT. As BOOST_PP_IS_EMPTY is not a general purpose emptiness checker, we limit the ways it can be used. --- .../adapted/struct/detail/adapt_base.hpp | 27 ++++++------------- test/sequence/adapt_struct.cpp | 4 +-- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index ee3c5ff2..7d3f40dd 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -196,20 +196,19 @@ #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END -#if BOOST_PP_VARIADICS +#define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X, Y) \ + BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ + ((1, (Y))), \ + ((2, (X,Y))) \ + ) -# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(...) \ - BOOST_PP_IF(BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 2), \ - BOOST_PP_IF( \ - BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ - ((1, (BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__)) )), \ - ((2, BOOST_PP_VARIADIC_TO_TUPLE(__VA_ARGS__)))), \ - ((1, (BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)) ))) +#if BOOST_PP_VARIADICS # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, data, 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_ATTRIBUTE_FILLER(elem) \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(BOOST_FUSION_ADAPT_AUTO, \ + elem) \ ) # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(...) \ @@ -220,16 +219,6 @@ (0,0) \ ) -#else // BOOST_PP_VARIADICS - -# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X, Y) \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ - ((1, (Y))), \ - ((2, (X,Y))) \ - ) - - - #endif // BOOST_PP_VARIADICS diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index ca1770a4..bb8c7cb3 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -62,8 +62,8 @@ namespace ns BOOST_FUSION_ADAPT_STRUCT( ns::point, (int, x) - (int, y), - z + (BOOST_FUSION_ADAPT_AUTO, y) + (, z) ) #if !BOOST_WORKAROUND(__GNUC__,<4) From c851252f652a0a794a148f3c7e83cfaf9be741bd Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 00:03:22 +0200 Subject: [PATCH 25/85] Renaming macros for ADAPT_STRUCT to deduce type or take provided attribute types. --- .../fusion/adapted/struct/detail/adapt_base.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 7d3f40dd..a17c4ef2 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -60,11 +60,15 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \ BOOST_PP_TUPLE_EAT(1))(SEQ) -#define BOOST_FUSION_ATTRIBUTE_TYPE_DEDUCE(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE)\ - BOOST_TYPEOF(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)::BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ - ) +#define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ + BOOST_TYPEOF( \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + :: \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) \ -#define BOOST_FUSION_GET_GIVEN_TYPE(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ +#define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS @@ -131,7 +135,7 @@ { \ typedef \ BOOST_PP_IF(BOOST_PP_LESS(ATTRIBUTE_TUPEL_SIZE,2), \ - BOOST_FUSION_ATTRIBUTE_TYPE_DEDUCE, BOOST_FUSION_GET_GIVEN_TYPE \ + BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE \ )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ attribute_type; \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ From 687b2cf097046ed3d40128167e3f719d9b3691c2 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 00:13:14 +0200 Subject: [PATCH 26/85] Factoring out of adapt_struct.hpp all the FILLER_* macros details. As of BOOST_FUSION_ADAPT_STRUCT without type deduction, there were only simple attributes filler. Now this need more complex logic to handle both API: the backward compatible one with type specificiation, the one without type specification and the non-variadic one which enables omitting the type specification by providing BOOST_FUSION_ADAPT_AUTO instead of the type. That's why I extracted the FILLER_* macros details in a separate source file. --- .../fusion/adapted/struct/adapt_struct.hpp | 8 +-- .../adapted/struct/detail/adapt_base.hpp | 40 +------------ .../struct/detail/adapt_base_attr_filler.hpp | 56 +++++++++++++++++++ 3 files changed, 59 insertions(+), 45 deletions(-) create mode 100644 include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index a5688e0d..58c4c4d6 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -12,10 +12,6 @@ #include #include -#include -#include -#include -#include #include #include #include @@ -37,8 +33,6 @@ #include #include -#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() - #define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ TEMPLATE_PARAMS_SEQ, \ @@ -59,6 +53,8 @@ BOOST_FUSION_ADAPT_STRUCT_C) +#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() + #if BOOST_PP_VARIADICS # define BOOST_FUSION_ADAPT_STRUCT(NAME, ...) \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index a17c4ef2..90bac86c 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -189,43 +188,6 @@ } \ }; -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ - BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X,Y) \ - BOOST_FUSION_ADAPT_STRUCT_FILLER_1 - -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ - BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X,Y) \ - BOOST_FUSION_ADAPT_STRUCT_FILLER_0 - -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END -#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END - -#define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X, Y) \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ - ((1, (Y))), \ - ((2, (X,Y))) \ - ) - -#if BOOST_PP_VARIADICS - -# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, data, 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_ATTRIBUTE_FILLER(BOOST_FUSION_ADAPT_AUTO, \ - elem) \ - ) - -# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(...) \ - 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__)), \ - (0,0) \ - ) - -#endif // BOOST_PP_VARIADICS - - #define BOOST_FUSION_ADAPT_STRUCT_BASE( \ TEMPLATE_PARAMS_SEQ, \ NAME_SEQ, \ 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 new file mode 100644 index 00000000..4ad03a26 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_attr_filler.hpp @@ -0,0 +1,56 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP + +#include +#include + +#include +#include +#include +#include +#include + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_1 + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0 + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END + +#define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X, Y) \ + BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ + ((1, (Y))), \ + ((2, (X,Y))) \ + ) + +#if BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, data, 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_ATTRIBUTE_FILLER(BOOST_FUSION_ADAPT_AUTO, \ + elem) \ + ) + +# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(...) \ + 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__)), \ + (0,0) \ + ) + +#endif // BOOST_PP_VARIADICS + +#endif From ce3f2d6020ba490805e0fd030b640e8bf94924b5 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 00:27:22 +0200 Subject: [PATCH 27/85] Added new ADAPT_STRUCT API support for the ADAPT_STRUCT_AS_VIEW macro. --- .../fusion/adapted/struct/adapt_struct.hpp | 31 +++++++++++++------ .../adapted/struct/detail/adapt_base.hpp | 1 - 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 58c4c4d6..6a70419c 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,15 @@ 0, \ BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \ BOOST_FUSION_ADAPT_STRUCT_C) + +# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ...) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 1, \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \ + BOOST_FUSION_ADAPT_STRUCT_C) #else // BOOST_PP_VARIADICS @@ -79,15 +89,18 @@ _END), \ BOOST_FUSION_ADAPT_STRUCT_C) +# define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 1, \ + BOOST_PP_CAT( \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES, \ + _END), \ + BOOST_FUSION_ADAPT_STRUCT_C) + + #endif // BOOST_PP_VARIADICS -#define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (0), \ - (0)(NAME), \ - struct_tag, \ - 1, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ - BOOST_FUSION_ADAPT_STRUCT_C) - #endif diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 90bac86c..3dafd0cb 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include From 04ce8a788b564e6efcc31885fd63b97f5df13633 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 00:37:35 +0200 Subject: [PATCH 28/85] Enabled new ADAPT_STRUCT_API for ADAPT_TPL_STRUCT. --- .../fusion/adapted/struct/adapt_struct.hpp | 44 ++++++++++++------- test/sequence/adapt_tpl_struct.cpp | 2 +- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 6a70419c..95df82b0 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -43,29 +43,28 @@ BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE), \ BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)) -#define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (1)TEMPLATE_PARAMS_SEQ, \ - (1)NAME_SEQ, \ - struct_tag, \ - 0, \ - ((0,0)) BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ - BOOST_FUSION_ADAPT_STRUCT_C) - #define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() #if BOOST_PP_VARIADICS +# define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ...) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (1)TEMPLATE_PARAMS_SEQ, \ + (1)NAME_SEQ, \ + struct_tag, \ + 0, \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \ + BOOST_FUSION_ADAPT_STRUCT_C) + # define BOOST_FUSION_ADAPT_STRUCT(NAME, ...) \ - BOOST_FUSION_ADAPT_STRUCT_BASE( \ - (0), \ - (0)(NAME), \ - struct_tag, \ - 0, \ - BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \ - BOOST_FUSION_ADAPT_STRUCT_C) + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + 0, \ + BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(__VA_ARGS__), \ + BOOST_FUSION_ADAPT_STRUCT_C) # define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ...) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ @@ -78,6 +77,17 @@ #else // BOOST_PP_VARIADICS +# define BOOST_FUSION_ADAPT_TPL_STRUCT( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (1)TEMPLATE_PARAMS_SEQ, \ + (1)NAME_SEQ, \ + struct_tag, \ + 0, \ + ((0,0)) BOOST_PP_CAT( \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_STRUCT_C) + # define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ (0), \ diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index 352cf995..1c0ae6d6 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -41,7 +41,7 @@ namespace ns BOOST_FUSION_ADAPT_TPL_STRUCT( (X)(Y), (ns::point)(X)(Y), - (X, x) + (BOOST_FUSION_ADAPT_AUTO, x) (Y, y) ) From 6483cf40582a6b6bb878c56d4911be9803c9006a Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 01:14:13 +0200 Subject: [PATCH 29/85] Adding documentation of the new ADAPT_STRUCT and ADAPT_STRUCT_TPL macros, capable of deducing type. --- doc/adapted.qbk | 81 ++++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 32 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index 2f77a0c6..f3e74367 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -177,7 +177,7 @@ __boost_tuple_library__ [endsect] -[section:adapt_struct BOOST_FUSION_ \[AUTO_\] ADAPT_STRUCT] +[section:adapt_struct BOOST_FUSION_ADAPT_STRUCT] [heading Description] BOOST_FUSION_ADAPT_STRUCT is a macro that can be used to generate all the @@ -187,15 +187,18 @@ __random_access_sequence__. [heading Synopsis] BOOST_FUSION_ADAPT_STRUCT( struct_name, - (member_type0, member_name0) - (member_type1, member_name1) + member_name0, + member_name1, + member_name2, ... ) + // When Variadic support isn't available or you wish to manually specify the type: BOOST_FUSION_AUTO_ADAPT_STRUCT( struct_name, - (member_name0) - (member_name1) + (member_type0, member_name0) + (member_type1, member_name1) + (BOOST_FUSION_ADAPT_AUTO, member_name2) ... ) @@ -203,11 +206,13 @@ __random_access_sequence__. The above macro generates the necessary code to adapt `struct_name` as a model of __random_access_sequence__. -The sequence of `(member_typeN, member_nameN)` -pairs declares the type and names of each of the struct members that are -part of the sequence. While the auto version of the macro only allows -specifying a sequence of `(member_nameN)` as fields' types are deduced with -[@boost:/libs/typeof/index.html Boost.TypeOf]. + +The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)` +pairs declares the type and names of each of the struct members that are part of +the sequence. + +Omitting the type or using BOOST_FUSION_ADAPT_AUTO can be used to infer the type, +as with decltype. The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -215,7 +220,6 @@ namespace qualified name of the struct to be adapted. [heading Header] #include - #include #include [heading Example: BOOST_FUSION_ADAPT_STRUCT ] @@ -231,25 +235,15 @@ namespace qualified name of the struct to be adapted. // demo::employee is now a Fusion sequence BOOST_FUSION_ADAPT_STRUCT( demo::employee, - (std::string, name) - (int, age)) + name, + age) - -[heading Example: BOOST_FUSION_AUTO_ADAPT_STRUCT ] - namespace demo - { - struct employee - { - std::string name; - int age; - }; - } - - // demo::employee is now a Fusion sequence - BOOST_FUSION_AUTO_ADAPT_STRUCT( + // Or demo::employee is also a Fusion sequence + BOOST_FUSION_ADAPT_STRUCT( demo::employee, - (name) - (age)) + (BOOST_FUSION_ADAPT_AUTO, name) + (BOOST_FUSION_ADAPT_AUTO, age) + ) [endsect] @@ -261,11 +255,21 @@ necessary boilerplate to make an arbitrary template struct a model of __random_access_sequence__. [heading Synopsis] + BOOST_FUSION_ADAPT_TPL_STRUCT( + (template_param0)(template_param1)..., + (struct_name) (specialization_param0)(specialization_param1)..., + member_name0, + member_name1 + ... + ) + + // When Variadic support isn't available or you wish to manually specify the type: BOOST_FUSION_ADAPT_TPL_STRUCT( (template_param0)(template_param1)..., (struct_name) (specialization_param0)(specialization_param1)..., (member_type0, member_name0) (member_type1, member_name1) + (BOOST_FUSION_ADAPT_AUTO, member_name2), ... ) @@ -279,9 +283,12 @@ the template type parameters used. The sequence `(specialization_param0)(specialization_param1)...` declares the template parameters of the actual specialization of `struct_name` that is adapted as a fusion sequence. -The sequence of `(member_typeN, member_nameN)` -pairs declares the type and names of each of the struct members that are -part of the sequence. +The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)` +pairs declares the type and names of each of the struct members that are part of +the sequence. + +Omitting the type or using BOOST_FUSION_ADAPT_AUTO can be used to infer the type, +as with decltype. The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -299,6 +306,7 @@ namespace qualified name of the struct to be adapted. { Name name; Age age; + int employment_timestamp; }; } @@ -307,7 +315,16 @@ namespace qualified name of the struct to be adapted. (Name)(Age), (demo::employee) (Name)(Age), (Name, name) - (Age, age)) + (Age, age) + (BOOST_FUSION_ADAPT_AUTO, employment_timestamp)) + + // Or by infering type completely + BOOST_FUSION_ADAPT_TPL_STRUCT( + (Name)(Age), + (demo::employee) (Name)(Age), + name, + age, + employment_timestamp) [endsect] From 0000ca263b29868f66afe8cd5e3e9bc27e93ec15 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 01:19:00 +0200 Subject: [PATCH 30/85] Removing AUTO_ADAPT_STRUCT_NAMED, AUTO_ADAPT_ASSOC_STRUCT and AUTO_ADAPT_ASSOC_STRUCT_NAMED. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As discussed with Agustín Bergé and Joel de Guzman on https://github.com/boostorg/fusion/pull/3, it's better to remove the separate macro for the type deducting macros, and to instead support a flexible API allowing backward compatibility and type omission. This is what ADAPT_STRUCT and ADAPT_STRUCT_TPL now provides. All other macros will be improved in the same way in the following commits. --- doc/adapted.qbk | 139 ++++-------------------------------------------- 1 file changed, 10 insertions(+), 129 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index f3e74367..10e88c71 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -328,7 +328,7 @@ namespace qualified name of the struct to be adapted. [endsect] -[section:adapt_struct_named BOOST_FUSION_ \[AUTO_\] ADAPT_STRUCT_NAMED] +[section:adapt_struct_named BOOST_FUSION_ADAPT_STRUCT_NAMED] [heading Description] BOOST_FUSION_ADAPT_STRUCT_NAMED and BOOST_FUSION_ADAPT_STRUCT_NAMED_NS are @@ -336,7 +336,6 @@ macros that can be used to generate all the necessary boilerplate to make an arbitrary struct a model of __random_access_sequence__. The given struct is adapted using the given name. - [heading Synopsis] BOOST_FUSION_ADAPT_STRUCT_NAMED( struct_name, adapted_name, @@ -345,13 +344,6 @@ adapted using the given name. ... ) - BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED( - struct_name, adapted_name, - (member_name0) - (member_name1) - ... - ) - BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( struct_name, (namespace0)(namespace1)..., @@ -361,17 +353,6 @@ adapted using the given name. ... ) - BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS( - struct_name, - (namespace0)(namespace1)..., - adapted_name, - (member_name0) - (member_name1) - ... - ) - - - [heading Semantics] The above macros generate the necessary code to adapt `struct_name` @@ -384,11 +365,9 @@ If an empty namespace sequence is given (that is a macro that expands to nothing), the adapted view is placed in the global namespace. If no namespace sequence is given (i.e. `BOOST_FUSION_ADAPT_STRUCT_NAMED`), the adapted view is placed in the namespace `boost::fusion::adapted`. -In the non-auto version of the macro the sequence of -`(member_typeN, member_nameN)` pairs declares the type and names of each of the -struct members that are part of the sequence. -While the auto version of the macro only allows specifying a sequence of -`(member_nameN)` as fields' types are deduced with [@boost:/libs/typeof/index.html Boost.TypeOf]. +The sequence of `(member_typeN, member_nameN)` +pairs declares the type and names of each of the struct members that are +part of the sequence. The macros should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be converted. @@ -396,10 +375,9 @@ namespace qualified name of the struct to be converted. [heading Header] #include - #include #include -[heading Example: BOOST_FUSION_ADAPT_STRUCT_NAMED] +[heading Example] namespace demo { struct employee @@ -416,26 +394,9 @@ namespace qualified name of the struct to be converted. (std::string, name) (int, age)) -[heading Example: BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED] - namespace demo - { - struct employee - { - std::string name; - int age; - }; - } - - // boost::fusion::adapted::adapted_employee is now a Fusion sequence - // referring to demo::employee - BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED( - demo::employee, adapted_employee, - (name) - (age)) - [endsect] -[section:adapt_assoc BOOST_FUSION_ \[AUTO_\] ADAPT_ASSOC_STRUCT] +[section:adapt_assoc BOOST_FUSION_ADAPT_ASSOC_STRUCT] [heading Description] BOOST_FUSION_ADAPT_ASSOC_STRUCT is a macro that can be used to generate all the @@ -450,24 +411,13 @@ __random_access_sequence__ and __associative_sequence__. ... ) - BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT( - struct_name, - (member_name0, key_type0) - (member_name1, key_type1) - ... - ) - [heading Semantics] The above macro generates the necessary code to adapt `struct_name` as a model of __random_access_sequence__ and __associative_sequence__. The sequence of `(member_typeN, member_nameN, key_typeN)` triples declares the type, name and key type of each of the struct members -that are part of the sequence. - -While BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT only allows specifying a sequence of -`(member_nameN, key_typeN)` as fields' types are deduced with -[@boost:/libs/typeof/index.html Boost.TypeOf]. +that are part of the sequence. The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -475,10 +425,9 @@ namespace qualified name of the struct to be adapted. [heading Header] #include - #include #include -[heading Example : BOOST_FUSION_ADAPT_ASSOC_STRUCT] +[heading Example] namespace demo { struct employee @@ -502,30 +451,6 @@ namespace qualified name of the struct to be adapted. (std::string, name, keys::name) (int, age, keys::age)) -[heading Example : BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT] - namespace demo - { - struct employee - { - std::string name; - int age; - }; - } - - namespace keys - { - struct name; - struct age; - } - - // demo::employee is now a Fusion sequence. - // It is also an associative sequence with - // keys keys::name and keys::age present. - BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT( - demo::employee, - (name, keys::name) - (age, keys::age)) - [endsect] [section:adapt_assoc_tpl_struct BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT] @@ -594,7 +519,7 @@ namespace qualified name of the struct to be adapted. [endsect] -[section:adapt_assoc_struct_named BOOST_FUSION_ \[AUTO_\] ADAPT_ASSOC_STRUCT_NAMED] +[section:adapt_assoc_struct_named BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED] [heading Description] BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED and BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS are @@ -610,13 +535,6 @@ __associative_sequence__. The given struct is adapted using the given name. ... ) - BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED( - struct_name, adapted_name, - (member_name0, key_type0) - (member_name1, key_type1) - ... - ) - BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( struct_name, (namespace0)(namespace1)..., @@ -626,15 +544,6 @@ __associative_sequence__. The given struct is adapted using the given name. ... ) - BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_NS( - struct_name, - (namespace0)(namespace1)..., - adapted_name, - (member_name0, key_type0) - (member_name1, key_type1) - ... - ) - [heading Semantics] The above macros generate the necessary code to adapt `struct_name` @@ -651,20 +560,15 @@ The sequence of `(member_typeN, member_nameN, key_typeN)` triples declares the type, name and key type of each of the struct members that are part of the sequence. -While BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED only allows specifying a -sequence of `(member_nameN, key_typeN)` as fields' types are deduced with -[@boost:/libs/typeof/index.html Boost.TypeOf]. - The macros should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be converted. [heading Header] #include - #include #include -[heading Example : BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED] +[heading Example] namespace demo { struct employee @@ -687,29 +591,6 @@ namespace qualified name of the struct to be converted. (std::string, name, keys::name) (int, age, keys::age)) -[heading Example : BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED] - namespace demo - { - struct employee - { - std::string name; - int age; - }; - } - - namespace keys - { - struct name; - struct age; - } - - // boost::fusion::adapted::adapted_employee is now a Fusion sequence - // referring to demo::employee - BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED( - demo::employee, adapted_employee, - (name, keys::name) - (age, keys::age)) - [endsect] [section:adapt_adt BOOST_FUSION_ADAPT_ADT] From 4cf96e14f3d3c9336789dafef210716881f186ef Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 01:43:57 +0200 Subject: [PATCH 31/85] Added test for the new ADAPT_STRUCT API capable to deduce member types. --- test/sequence/adapt_struct.cpp | 98 ++++++---- test/sequence/adapt_tpl_struct.cpp | 63 ++++--- test/sequence/auto_adapt_assoc_struct.cpp | 141 --------------- .../auto_adapt_assoc_struct_named.cpp | 121 ------------- test/sequence/auto_adapt_struct.cpp | 169 ------------------ test/sequence/auto_adapt_struct_named.cpp | 137 -------------- 6 files changed, 106 insertions(+), 623 deletions(-) delete mode 100644 test/sequence/auto_adapt_assoc_struct.cpp delete mode 100644 test/sequence/auto_adapt_assoc_struct_named.cpp delete mode 100644 test/sequence/auto_adapt_struct.cpp delete mode 100644 test/sequence/auto_adapt_struct_named.cpp diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index bb8c7cb3..819ec009 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -4,8 +4,6 @@ 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) ==============================================================================*/ -#define BOOST_PP_VARIADICS 1 - #include #include #include @@ -51,32 +49,59 @@ namespace ns private: int x; int y; + int z; public: - point_with_private_attributes(int x, int y):x(x),y(y) + point_with_private_attributes(int x, int y, int z):x(x),y(y),z(z) {} }; #endif } -BOOST_FUSION_ADAPT_STRUCT( - ns::point, - (int, x) - (BOOST_FUSION_ADAPT_AUTO, y) - (, z) -) +#if BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_STRUCT( + ns::point, + x, + y, + z + ) + +# if !BOOST_WORKAROUND(__GNUC__,<4) + BOOST_FUSION_ADAPT_STRUCT( + ns::point_with_private_attributes, + x, + y, + z + ) +# endif + + struct s { int m; }; + BOOST_FUSION_ADAPT_STRUCT(s, m) + +#else // BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_STRUCT( + ns::point, + (int, x) + (int, y) + (BOOST_FUSION_ADAPT_AUTO, z) + ) + +# if !BOOST_WORKAROUND(__GNUC__,<4) + BOOST_FUSION_ADAPT_STRUCT( + ns::point_with_private_attributes, + (int, x) + (int, y) + (BOOST_FUSION_ADAPT_AUTO, z) + ) +# endif + + struct s { int m; }; + BOOST_FUSION_ADAPT_STRUCT(s, (BOOST_FUSION_ADAPT_AUTO, m)) -#if !BOOST_WORKAROUND(__GNUC__,<4) -BOOST_FUSION_ADAPT_STRUCT( - ns::point_with_private_attributes, - (int, x) - (int, y) -) #endif -struct s { int m; }; -BOOST_FUSION_ADAPT_STRUCT(s, (int, m)) - int main() { @@ -88,29 +113,31 @@ main() std::cout << tuple_delimiter(", "); { - BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p = {123, 456}; + BOOST_MPL_ASSERT_NOT((traits::is_view)); + point p = {123, 456, 789}; std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456, 4)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; + at_c<2>(p) = 12; BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); - BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); + BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2, 3); - ns::point v2 = {5, 3, 2}; - fusion::vector v3(5, 4, 2); + vector v1(4, 2, 2); + point v2 = {5, 3, 3}; + vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -122,16 +149,16 @@ main() } { - // conversion from ns::point to vector - ns::point p = {5, 3, 4}; - fusion::vector v(p); + // conversion from point to vector + point p = {5, 3, 3}; + vector v(p); v = p; } { - // conversion from ns::point to list - ns::point p = {5, 3, 4}; - fusion::list l(p); + // conversion from point to list + point p = {5, 3, 3}; + list l(p); l = p; } @@ -154,12 +181,13 @@ main() #if !BOOST_WORKAROUND(__GNUC__,<4) { - ns::point_with_private_attributes p(123, 456); + ns::point_with_private_attributes p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); } #endif diff --git a/test/sequence/adapt_tpl_struct.cpp b/test/sequence/adapt_tpl_struct.cpp index 1c0ae6d6..86face6d 100644 --- a/test/sequence/adapt_tpl_struct.cpp +++ b/test/sequence/adapt_tpl_struct.cpp @@ -35,19 +35,40 @@ namespace ns { X x; Y y; + int z; }; } -BOOST_FUSION_ADAPT_TPL_STRUCT( - (X)(Y), - (ns::point)(X)(Y), - (BOOST_FUSION_ADAPT_AUTO, x) - (Y, y) -) +#if BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_TPL_STRUCT( + (X)(Y), + (ns::point)(X)(Y), + x, + (BOOST_FUSION_ADAPT_AUTO, y) + (int, z) + ) + + template + struct s { M m; }; + BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), m) + +#else // BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_TPL_STRUCT( + (X)(Y), + (ns::point)(X)(Y), + (X, x) + (Y, y) + (BOOST_FUSION_ADAPT_AUTO, z) + ) + + template + struct s { M m; }; + BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (BOOST_FUSION_ADAPT_AUTO, m)) + +#endif -template -struct s { M m; }; -BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (M, m)) int main() @@ -62,28 +83,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - point p = {123, 456}; + point p = {123, 456, 789}; std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - vector v1(4, 2); - point v2 = {5, 3}; - vector v3(5, 4); + vector v1(4, 2, 2); + point v2 = {5, 3, 3}; + vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -96,14 +119,14 @@ main() { // conversion from point to vector - point p = {5, 3}; - vector v(p); + point p = {5, 3, 3}; + vector v(p); v = p; } { // conversion from point to list - point p = {5, 3}; + point p = {5, 3, 3}; list l(p); l = p; } diff --git a/test/sequence/auto_adapt_assoc_struct.cpp b/test/sequence/auto_adapt_assoc_struct.cpp deleted file mode 100644 index 177df20b..00000000 --- a/test/sequence/auto_adapt_assoc_struct.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2007 Joel de Guzman - Copyright (c) 2005-2007 Dan Marsden - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ns -{ - struct x_member; - struct y_member; - struct z_member; - - struct point - { - int x; - int y; - }; -} - -BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT( - ns::point, - (x, ns::x_member) - (y, ns::y_member) -) - -int -main() -{ - using namespace boost::fusion; - using namespace boost; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - - { - BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p = {123, 456}; - - std::cout << at_c<0>(p) << std::endl; - std::cout << at_c<1>(p) << std::endl; - std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); - - at_c<0>(p) = 6; - at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); - - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); - BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); - - BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); - } - - { - fusion::vector v1(4, 2); - ns::point v2 = {5, 3}; - fusion::vector v3(5, 4); - BOOST_TEST(v1 < v2); - BOOST_TEST(v1 <= v2); - BOOST_TEST(v2 > v1); - BOOST_TEST(v2 >= v1); - BOOST_TEST(v2 < v3); - BOOST_TEST(v2 <= v3); - BOOST_TEST(v3 > v2); - BOOST_TEST(v3 >= v2); - } - - { - // conversion from ns::point to vector - ns::point p = {5, 3}; - fusion::vector v(p); - v = p; - } - - { - // conversion from ns::point to list - ns::point p = {5, 3}; - fusion::list l(p); - l = p; - } - - { - // assoc stuff - BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((mpl::not_ >)); - - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - - ns::point p = {5, 3}; - - BOOST_TEST(at_key(p) == 5); - BOOST_TEST(at_key(p) == 3); - } - - { - BOOST_MPL_ASSERT((mpl::is_sequence)); - BOOST_MPL_ASSERT((boost::is_same< - boost::fusion::result_of::value_at_c::type - , mpl::front::type>)); - } - - return boost::report_errors(); -} - diff --git a/test/sequence/auto_adapt_assoc_struct_named.cpp b/test/sequence/auto_adapt_assoc_struct_named.cpp deleted file mode 100644 index b2e85541..00000000 --- a/test/sequence/auto_adapt_assoc_struct_named.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/*============================================================================= - Copyright (c) 2010 Christopher Schmidt - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ns -{ - struct x_member; - struct y_member; - struct z_member; - - struct point - { - int x; - int y; - }; -} - -BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED( - ns::point, - point, - (x, ns::x_member) - (y, ns::y_member) -) - -int -main() -{ - using namespace boost::fusion; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - - { - BOOST_MPL_ASSERT((traits::is_view)); - ns::point basep = {123, 456}; - adapted::point p(basep); - - std::cout << at_c<0>(p) << std::endl; - std::cout << at_c<1>(p) << std::endl; - std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); - - at_c<0>(p) = 6; - at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); - - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); - BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); - - BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); - } - - { - vector v1(4, 2); - ns::point basev2 = {5, 3}; - adapted::point v2(basev2); - - vector v3(5, 4); - BOOST_TEST(v1 < v2); - BOOST_TEST(v1 <= v2); - BOOST_TEST(v2 > v1); - BOOST_TEST(v2 >= v1); - BOOST_TEST(v2 < v3); - BOOST_TEST(v2 <= v3); - BOOST_TEST(v3 > v2); - BOOST_TEST(v3 >= v2); - } - - { - // conversion from adapted::point to vector - ns::point basep = {5, 3}; - adapted::point p(basep); - vector v(p); - v = p; - } - - { - // conversion from adapted::point to list - ns::point basep = {5, 3}; - adapted::point p(basep); - list l(p); - l = p; - } - - { - // assoc stuff - BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); - - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - BOOST_MPL_ASSERT((boost::is_same::type, int>)); - - ns::point basep = {5, 3}; - adapted::point p(basep); - - BOOST_TEST(at_key(p) == 5); - BOOST_TEST(at_key(p) == 3); - } - - return boost::report_errors(); -} - diff --git a/test/sequence/auto_adapt_struct.cpp b/test/sequence/auto_adapt_struct.cpp deleted file mode 100644 index e7ce2890..00000000 --- a/test/sequence/auto_adapt_struct.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2007 Joel de Guzman - Copyright (c) 2013-2014 Damien Buhl - - 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ns -{ - struct point - { - int x; - int y; - }; - -#if !BOOST_WORKAROUND(__GNUC__,<4) - struct point_with_private_attributes - { - friend struct boost::fusion::extension::access; - - private: - int x; - int y; - - public: - point_with_private_attributes(int x, int y):x(x),y(y) - {} - }; -#endif -} - -/*BOOST_FUSION_AUTO_ADAPT_STRUCT( - ns::point, - (x) - (y) -)*/ - -BOOST_FUSION_AUTO_ADAPT_STRUCT( - ns::point, - x, y -) - -#if !BOOST_WORKAROUND(__GNUC__,<4) -BOOST_FUSION_AUTO_ADAPT_STRUCT( - ns::point_with_private_attributes, - (x) - (y) -) -#endif - -struct s { int m; }; -BOOST_FUSION_AUTO_ADAPT_STRUCT(s, (m)) - -int -main() -{ - using namespace boost::fusion; - using namespace boost; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - - { - BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p = {123, 456}; - - std::cout << at_c<0>(p) << std::endl; - std::cout << at_c<1>(p) << std::endl; - std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); - - at_c<0>(p) = 6; - at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); - - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); - BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); - - BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); - } - - { - fusion::vector v1(4, 2); - ns::point v2 = {5, 3}; - fusion::vector v3(5, 4); - BOOST_TEST(v1 < v2); - BOOST_TEST(v1 <= v2); - BOOST_TEST(v2 > v1); - BOOST_TEST(v2 >= v1); - BOOST_TEST(v2 < v3); - BOOST_TEST(v2 <= v3); - BOOST_TEST(v3 > v2); - BOOST_TEST(v3 >= v2); - } - - { - // conversion from ns::point to vector - ns::point p = {5, 3}; - fusion::vector v(p); - v = p; - } - - { - // conversion from ns::point to list - ns::point p = {5, 3}; - fusion::list l(p); - l = p; - } - - { // begin/end - using namespace boost::fusion; - using boost::is_same; - - typedef boost::fusion::result_of::begin::type b; - typedef boost::fusion::result_of::end::type e; - // this fails - BOOST_MPL_ASSERT((is_same::type, e>)); - } - - { - BOOST_MPL_ASSERT((mpl::is_sequence)); - BOOST_MPL_ASSERT((boost::is_same< - boost::fusion::result_of::value_at_c::type - , mpl::front::type>)); - } - -#if !BOOST_WORKAROUND(__GNUC__,<4) - { - ns::point_with_private_attributes p(123, 456); - - std::cout << at_c<0>(p) << std::endl; - std::cout << at_c<1>(p) << std::endl; - std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); - } -#endif - - return boost::report_errors(); -} diff --git a/test/sequence/auto_adapt_struct_named.cpp b/test/sequence/auto_adapt_struct_named.cpp deleted file mode 100644 index 1ada8efe..00000000 --- a/test/sequence/auto_adapt_struct_named.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2007 Joel de Guzman - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace ns -{ - struct point - { - int x; - int y; - }; -} - -// this creates a fusion view: boost::fusion::adapted::point -BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED( - ns::point, point, - (x) - (y) -) - -// this creates a fusion view: ns1::s1 -struct s { int m; }; -BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (m)) - -int -main() -{ - using namespace boost::fusion; - using namespace boost; - - std::cout << tuple_open('['); - std::cout << tuple_close(']'); - std::cout << tuple_delimiter(", "); - - { - BOOST_MPL_ASSERT((traits::is_view)); - ns::point basep = {123, 456}; - adapted::point p(basep); - - std::cout << at_c<0>(p) << std::endl; - std::cout << at_c<1>(p) << std::endl; - std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); - - at_c<0>(p) = 6; - at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); - - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); - BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); - - BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); - } - - { - fusion::vector v1(4, 2); - ns::point p = {5, 3}; - adapted::point v2(p); - - fusion::vector v3(5, 4); - BOOST_TEST(v1 < v2); - BOOST_TEST(v1 <= v2); - BOOST_TEST(v2 > v1); - BOOST_TEST(v2 >= v1); - BOOST_TEST(v2 < v3); - BOOST_TEST(v2 <= v3); - BOOST_TEST(v3 > v2); - BOOST_TEST(v3 >= v2); - } - - { - // conversion from adapted::point to vector - ns::point basep = {5, 3}; - adapted::point p(basep); - fusion::vector v(p); - v = p; - } - - { - // conversion from adapted::point to list - ns::point basep = {5, 3}; - adapted::point p(basep); - fusion::list l(p); - l = p; - } - - { // begin/end - using namespace boost::fusion; - using boost::is_same; - - typedef boost::fusion::result_of::begin::type b; - typedef boost::fusion::result_of::end::type e; - // this fails - BOOST_MPL_ASSERT((is_same::type, e>)); - } - - - { - BOOST_MPL_ASSERT((mpl::is_sequence)); - BOOST_MPL_ASSERT((boost::is_same< - boost::fusion::result_of::value_at_c::type - , mpl::front::type>)); - } - - return boost::report_errors(); -} - From 2e60ba6f29765884cefcde58d2e8694bbe973771 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 02:35:31 +0200 Subject: [PATCH 32/85] Fixed typos and inconsistencies in ADAPT_STRUCT documentation. --- doc/adapted.qbk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index 10e88c71..e6adfd29 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -193,8 +193,8 @@ __random_access_sequence__. ... ) - // When Variadic support isn't available or you wish to manually specify the type: - BOOST_FUSION_AUTO_ADAPT_STRUCT( + // When BOOST_PP_VARIADICS is missing : + BOOST_FUSION_ADAPT_STRUCT( struct_name, (member_type0, member_name0) (member_type1, member_name1) @@ -238,7 +238,7 @@ namespace qualified name of the struct to be adapted. name, age) - // Or demo::employee is also a Fusion sequence + // When BOOST_PP_VARIADICS is missing : BOOST_FUSION_ADAPT_STRUCT( demo::employee, (BOOST_FUSION_ADAPT_AUTO, name) @@ -263,7 +263,7 @@ __random_access_sequence__. ... ) - // When Variadic support isn't available or you wish to manually specify the type: + // When BOOST_PP_VARIADICS is missing : BOOST_FUSION_ADAPT_TPL_STRUCT( (template_param0)(template_param1)..., (struct_name) (specialization_param0)(specialization_param1)..., From 0e50a02fbc696c0597349e1576d1ac304b0888c2 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 02:36:08 +0200 Subject: [PATCH 33/85] Remove deleted unit tests from Jamfile. --- test/Jamfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/Jamfile b/test/Jamfile index 5587ab5d..1c84637d 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -136,15 +136,11 @@ project [ run sequence/adapt_assoc_adt_named.cpp : : : : ] [ run sequence/adapt_assoc_adt.cpp : : : : ] [ run sequence/adapt_assoc_struct_named.cpp : : : : ] - [ run sequence/auto_adapt_assoc_struct_named.cpp : : : : ] [ run sequence/adapt_assoc_struct.cpp : : : : ] - [ run sequence/auto_adapt_assoc_struct.cpp : : : : ] [ run sequence/adapt_assoc_tpl_adt.cpp : : : : ] [ run sequence/adapt_assoc_tpl_struct.cpp : : : : ] [ run sequence/adapt_struct_named.cpp : : : : ] - [ run sequence/auto_adapt_struct_named.cpp : : : : ] [ run sequence/adapt_struct.cpp : : : : ] - [ run sequence/auto_adapt_struct.cpp : : : : ] [ run sequence/adapt_tpl_adt.cpp : : : : ] [ run sequence/adapt_tpl_struct.cpp : : : : ] [ run sequence/adt_attribute_proxy.cpp : : : : ] From 9a501785e65b298e72ce44a9beffdc2e832011ad Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 11 Jun 2014 02:53:36 +0200 Subject: [PATCH 34/85] Removed the old auto_* headers. --- include/boost/fusion/adapted/struct.hpp | 2 - .../struct/auto_adapt_assoc_struct.hpp | 44 --------------- .../struct/auto_adapt_assoc_struct_named.hpp | 56 ------------------- .../struct/auto_adapt_struct_named.hpp | 32 ----------- 4 files changed, 134 deletions(-) delete mode 100644 include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp delete mode 100644 include/boost/fusion/adapted/struct/auto_adapt_assoc_struct_named.hpp delete mode 100644 include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp diff --git a/include/boost/fusion/adapted/struct.hpp b/include/boost/fusion/adapted/struct.hpp index 5a45b596..3f159038 100644 --- a/include/boost/fusion/adapted/struct.hpp +++ b/include/boost/fusion/adapted/struct.hpp @@ -14,9 +14,7 @@ #include #include #include -#include #include -#include #include #include #include diff --git a/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp deleted file mode 100644 index 936e1e74..00000000 --- a/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2007 Joel de Guzman - Copyright (c) 2007 Dan Marsden - Copyright (c) 2009-2011 Christopher Schmidt - Copyright (c) 2013-2014 Damien Buhl - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ - -#ifndef BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_ASSOC_STRUCT_HPP -#define BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_ASSOC_STRUCT_HPP - -#include -#include -#include - -#include - -#include - -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_0(A, B) \ - ((A, B)) BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_1 -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_1(A, B) \ - ((A, B)) BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_0 -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_0_END -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_1_END - -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_TYPE_DEDUCER(r, NAME, ATTRIBUTE) \ - (BOOST_TYPEOF(NAME::BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)), \ - BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE), \ - BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)) - -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT(NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT(NAME, \ - BOOST_PP_SEQ_FOR_EACH( \ - BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_TYPE_DEDUCER, \ - NAME, \ - BOOST_PP_CAT( \ - BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END) \ - ) \ - ) - -#endif diff --git a/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct_named.hpp b/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct_named.hpp deleted file mode 100644 index 1945c62c..00000000 --- a/include/boost/fusion/adapted/struct/auto_adapt_assoc_struct_named.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - Copyright (c) 2010-2011 Christopher Schmidt - Copyright (c) 2013-2014 Damien Buhl - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ - -#ifndef BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_ASSOC_STRUCT_NAMED_HPP -#define BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_ASSOC_STRUCT_NAMED_HPP - -#include -#include -#include - -#include - -#include - -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0(A, B) \ - ((A, B)) BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1 -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1(A, B) \ - ((A, B)) BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0_END -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1_END - -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_TYPE_DEDUCER( \ - r, NAME, ATTRIBUTE) \ - (BOOST_TYPEOF( \ - BOOST_PP_TUPLE_ELEM( \ - 2, \ - 0, \ - NAME) \ - ::BOOST_PP_TUPLE_ELEM( \ - 2, \ - 0, \ - ATTRIBUTE)), \ - BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE), \ - BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)) - -#define BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED( \ - WRAPPED_TYPE, NAME, ATTRIBUTES) \ - \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, \ - NAME, \ - BOOST_PP_SEQ_FOR_EACH( \ - BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_TYPE_DEDUCER, \ - (WRAPPED_TYPE, NAME), \ - BOOST_PP_CAT( \ - BOOST_FUSION_AUTO_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 ATTRIBUTES, \ - _END) \ - ) \ - ) - - -#endif diff --git a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp deleted file mode 100644 index de81fbcf..00000000 --- a/include/boost/fusion/adapted/struct/auto_adapt_struct_named.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2007 Joel de Guzman - Copyright (c) 2009-2010 Hartmut Kaiser - Copyright (c) 2010-2011 Christopher Schmidt - Copyright (c) 2013-2014 Damien Buhl - - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ - -#ifndef BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_STRUCT_NAMED_HPP -#define BOOST_FUSION_ADAPTED_STRUCT_AUTO_ADAPT_STRUCT_NAMED_HPP - -#include -#include - -#define BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS( \ - WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ - \ - BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ - WRAPPED_TYPE, NAMESPACE_SEQ, NAME, \ - BOOST_PP_SEQ_FOR_EACH( \ - BOOST_FUSION_AUTO_ADAPT_STRUCT_TYPE_DEDUCER, \ - WRAPPED_TYPE, \ - ATTRIBUTES)) - -#define BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ - BOOST_FUSION_AUTO_ADAPT_STRUCT_NAMED_NS( \ - WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) - -#endif From f0eab528e9c34349acb56cf82e507740718b3304 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sat, 14 Jun 2014 11:40:51 +0200 Subject: [PATCH 35/85] Fix adapt_struct test which was missing an using keyword. --- test/sequence/adapt_struct.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp index 819ec009..406030dd 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -107,6 +107,7 @@ main() { using namespace boost::fusion; using namespace boost; + using ns::point; std::cout << tuple_open('['); std::cout << tuple_close(']'); From af812e6207561bc8e092b0332c802554f4f696cb Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sat, 14 Jun 2014 12:09:04 +0200 Subject: [PATCH 36/85] Fixed ADAPT_STRUCT_FILLER macro call for consistency. --- include/boost/fusion/adapted/struct/adapt_struct.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 95df82b0..4c798518 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -84,8 +84,8 @@ (1)NAME_SEQ, \ struct_tag, \ 0, \ - ((0,0)) BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + BOOST_PP_CAT( \ + BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ BOOST_FUSION_ADAPT_STRUCT_C) # define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ From ae0c97692683c2f84ab8c18b02ac54f8a2c158d1 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sat, 14 Jun 2014 12:11:44 +0200 Subject: [PATCH 37/85] Fixes missing inclusion of BOOST_PP_LESS. This was bringing the std::pair adapt test to fail, because it wasn't including BOOST_PP_LESS like the other tests. --- include/boost/fusion/adapted/struct/detail/adapt_base.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 3dafd0cb..c5721224 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include From c008b0dc3afeaa50959bc1ac402e77d9db72d28b Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 17 Jun 2014 22:35:10 +0200 Subject: [PATCH 38/85] Fixes the BOOST_FUSION_DEFINE_STRUCT* macros with an appropriate attributes FILLER macro. As the BOOST_FUSION_ADAPT_STRUCT_FILLER* macros were changed to handle type deduction, this breaks the usage that BOOST_FUSION_DEFINE_STRUCT makes from them. That is BOOST_FUSION_DEFINE_STRUCT_IMPL expects a simple tuple, while we now provide a tuple containing the size of a nested tuple which either has or not the type provided. But in the case of the DEFINE* macros it would be a non-sense to support this kind of API as a field being defined cannot be deduced. :) --- include/boost/fusion/adapted/struct/define_struct.hpp | 4 ++-- .../boost/fusion/adapted/struct/detail/define_struct.hpp | 7 +++++++ .../fusion/adapted/struct/detail/define_struct_inline.hpp | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/boost/fusion/adapted/struct/define_struct.hpp b/include/boost/fusion/adapted/struct/define_struct.hpp index fa1f549f..29785436 100644 --- a/include/boost/fusion/adapted/struct/define_struct.hpp +++ b/include/boost/fusion/adapted/struct/define_struct.hpp @@ -19,7 +19,7 @@ TEMPLATE_PARAMS_SEQ, \ (0)NAMESPACE_SEQ, \ NAME, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ + BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ 2) \ \ BOOST_FUSION_ADAPT_TPL_STRUCT( \ @@ -32,7 +32,7 @@ BOOST_FUSION_DEFINE_STRUCT_IMPL( \ (0)NAMESPACE_SEQ, \ NAME, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ + BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0(0,0)ATTRIBUTES,_END), \ 2) \ \ BOOST_FUSION_ADAPT_STRUCT( \ diff --git a/include/boost/fusion/adapted/struct/detail/define_struct.hpp b/include/boost/fusion/adapted/struct/detail/define_struct.hpp index 44d99f06..a39a18f1 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct.hpp @@ -34,6 +34,13 @@ #include #include +#define BOOST_FUSION_DEFINE_STRUCT_FILLER_0(X, Y) \ + ((X, Y)) BOOST_FUSION_DEFINE_STRUCT_FILLER_1 +#define BOOST_FUSION_DEFINE_STRUCT_FILLER_1(X, Y) \ + ((X, Y)) BOOST_FUSION_DEFINE_STRUCT_FILLER_0 +#define BOOST_FUSION_DEFINE_STRUCT_FILLER_0_END +#define BOOST_FUSION_DEFINE_STRUCT_FILLER_1_END + #define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \ R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ \ 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 87ab09fa..5ddec309 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp @@ -301,7 +301,7 @@ #define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS(NAME, ATTRIBUTES) \ BOOST_FUSION_DEFINE_STRUCT_MEMBERS_IMPL( \ NAME, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END)) + BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0 ATTRIBUTES,_END)) // Note: can't compute BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ) directly because // ATTRIBUTES_SEQ may be empty and calling BOOST_PP_SEQ_SIZE on an empty @@ -315,7 +315,7 @@ #define BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR(NAME, ATTRIBUTES) \ BOOST_FUSION_DEFINE_STRUCT_ITERATOR_IMPL( \ NAME, \ - BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END)) + BOOST_PP_CAT(BOOST_FUSION_DEFINE_STRUCT_FILLER_0 ATTRIBUTES,_END)) #define BOOST_FUSION_DEFINE_STRUCT_ITERATOR_IMPL(NAME, ATTRIBUTES_SEQ) \ BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR_IMPL_IMPL( \ From abff92ab657333252c9a7a9e00274de99d294d5c Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 25 Jun 2014 00:11:40 +0200 Subject: [PATCH 39/85] Add support for members types deduction to the ADAPT_STRUCT_NAMED macro. --- .../fusion/adapted/struct/adapt_struct.hpp | 18 +++--- .../adapted/struct/adapt_struct_named.hpp | 49 +++++++++----- .../adapted/struct/detail/adapt_base.hpp | 28 ++++---- .../adapted/struct/detail/proxy_type.hpp | 2 + test/sequence/adapt_struct_named.cpp | 64 +++++++++++++------ 5 files changed, 102 insertions(+), 59 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 4c798518..9c1d19f1 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -34,14 +34,16 @@ #include #include -#define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\ - BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ, \ - NAME_SEQ, \ - I, \ - BOOST_PP_EMPTY, \ - BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE), \ - BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)) +#define BOOST_FUSION_ADAPT_STRUCT_C( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \ + BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + IS_VIEW, \ + I, \ + BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ + BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE), \ + BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)) #define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() diff --git a/include/boost/fusion/adapted/struct/adapt_struct_named.hpp b/include/boost/fusion/adapted/struct/adapt_struct_named.hpp index 3f29f3a3..791fb5b0 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct_named.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct_named.hpp @@ -15,26 +15,41 @@ #include #include -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0(X, Y) \ - (X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1 -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1(X, Y) \ - (X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0 -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0_END -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1_END +#ifdef BOOST_PP_VARIADICS -#define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ - WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ +# define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ...) \ \ - BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ - WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ + BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ \ - BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \ - BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \ - BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0 ATTRIBUTES,_END)) + BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \ + (0)NAMESPACE_SEQ)NAME, \ + __VA_ARGS__) -#define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ - BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ - WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) +# define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ...) \ + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,__VA_ARGS__) + + +#else // BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ + \ + BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \ + (0)NAMESPACE_SEQ)NAME, \ + ATTRIBUTES) + +# define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) + +#endif #endif diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index c5721224..26051395 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -59,16 +59,16 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \ BOOST_PP_TUPLE_EAT(1))(SEQ) + #define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ - BOOST_TYPEOF( \ - BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ - :: \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ + BOOST_TYPEOF( \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)::PREFIX() \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) #define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, unused) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS # define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ @@ -98,9 +98,10 @@ #endif #define BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL(R,DATA,I,ATTRIBUTE) \ - BOOST_PP_TUPLE_ELEM(3,0,DATA)( \ - BOOST_PP_TUPLE_ELEM(3,1,DATA), \ - BOOST_PP_TUPLE_ELEM(3,2,DATA), \ + BOOST_PP_TUPLE_ELEM(4,0,DATA)( \ + BOOST_PP_TUPLE_ELEM(4,1,DATA), \ + BOOST_PP_TUPLE_ELEM(4,2,DATA), \ + BOOST_PP_TUPLE_ELEM(4,3,DATA), \ I, \ ATTRIBUTE) @@ -122,7 +123,8 @@ #endif #define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, \ + I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -135,7 +137,7 @@ typedef \ BOOST_PP_IF(BOOST_PP_LESS(ATTRIBUTE_TUPEL_SIZE,2), \ BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE \ - )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ + )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ attribute_type; \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ @@ -216,7 +218,7 @@ namespace boost BOOST_PP_TUPLE_EAT(4))( \ 1, \ BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \ - (ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ), \ + (ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ, IS_VIEW),\ BOOST_PP_SEQ_TAIL(ATTRIBUTES_SEQ)) \ \ template< \ diff --git a/include/boost/fusion/adapted/struct/detail/proxy_type.hpp b/include/boost/fusion/adapted/struct/detail/proxy_type.hpp index 350137a4..f673a37c 100644 --- a/include/boost/fusion/adapted/struct/detail/proxy_type.hpp +++ b/include/boost/fusion/adapted/struct/detail/proxy_type.hpp @@ -12,6 +12,8 @@ #include #include +#define BOOST_FUSION_PROXY_PREFIX() obj. + #define BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ WRAPPED_TYPE,NAMESPACE_SEQ,NAME) \ \ diff --git a/test/sequence/adapt_struct_named.cpp b/test/sequence/adapt_struct_named.cpp index ef859655..aab11d2d 100644 --- a/test/sequence/adapt_struct_named.cpp +++ b/test/sequence/adapt_struct_named.cpp @@ -37,19 +37,39 @@ namespace ns { int x; int y; + int z; }; } -// this creates a fusion view: boost::fusion::adapted::point -BOOST_FUSION_ADAPT_STRUCT_NAMED( - ns::point, point, - (int, x) - (int, y) -) +#if BOOST_PP_VARIADICS -// this creates a fusion view: ns1::s1 -struct s { int m; }; -BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (int, m)) + // this creates a fusion view: boost::fusion::adapted::point + BOOST_FUSION_ADAPT_STRUCT_NAMED( + ns::point, point, + x, + y, + z + ) + + // this creates a fusion view: ns1::s1 + struct s { int m; }; + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, m) + +#else // BOOST_PP_VARIADICS + + // this creates a fusion view: boost::fusion::adapted::point + BOOST_FUSION_ADAPT_STRUCT_NAMED( + ns::point, point, + (int, x) + (int, y) + (BOOST_FUSION_ADAPT_AUTO, z) + ) + + // this creates a fusion view: ns1::s1 + struct s { int m; }; + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (BOOST_FUSION_ADAPT_AUTO, m)) + +#endif int main() @@ -63,31 +83,33 @@ main() { BOOST_MPL_ASSERT((traits::is_view)); - ns::point basep = {123, 456}; + ns::point basep = {123, 456, 789}; adapted::point p(basep); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2); - ns::point p = {5, 3}; + fusion::vector v1(4, 2, 2); + ns::point p = {5, 3, 3}; adapted::point v2(p); - fusion::vector v3(5, 4); + fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -100,17 +122,17 @@ main() { // conversion from adapted::point to vector - ns::point basep = {5, 3}; + ns::point basep = {5, 3, 3}; adapted::point p(basep); - fusion::vector v(p); + fusion::vector v(p); v = p; } { // conversion from adapted::point to list - ns::point basep = {5, 3}; + ns::point basep = {5, 3, 3}; adapted::point p(basep); - fusion::list l(p); + fusion::list l(p); l = p; } From dd0cee1721275b17e85c234eb3b7e06319cc8e22 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 25 Jun 2014 00:24:26 +0200 Subject: [PATCH 40/85] Documented type deduction for ADAPT_STRUCT_NAMED. --- doc/adapted.qbk | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index e6adfd29..1b5c97c0 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -337,10 +337,31 @@ arbitrary struct a model of __random_access_sequence__. The given struct is adapted using the given name. [heading Synopsis] + BOOST_FUSION_ADAPT_STRUCT_NAMED( + struct_name, adapted_name, + member_name0, + member_name1, + member_name2, + ... + ) + + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( + struct_name, + (namespace0)(namespace1)..., + adapted_name, + member_name0, + member_name1, + member_name2, + ... + ) + + // When BOOST_PP_VARIADICS is missing : + BOOST_FUSION_ADAPT_STRUCT_NAMED( struct_name, adapted_name, (member_type0, member_name0) (member_type1, member_name1) + (BOOST_FUSION_ADAPT_AUTO, member_name2), ... ) @@ -350,9 +371,12 @@ adapted using the given name. adapted_name, (member_type0, member_name0) (member_type1, member_name1) + (BOOST_FUSION_ADAPT_AUTO, member_name2), ... ) + + [heading Semantics] The above macros generate the necessary code to adapt `struct_name` @@ -365,9 +389,12 @@ If an empty namespace sequence is given (that is a macro that expands to nothing), the adapted view is placed in the global namespace. If no namespace sequence is given (i.e. `BOOST_FUSION_ADAPT_STRUCT_NAMED`), the adapted view is placed in the namespace `boost::fusion::adapted`. -The sequence of `(member_typeN, member_nameN)` -pairs declares the type and names of each of the struct members that are -part of the sequence. +The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)` +pairs declares the type and names of each of the struct members that are part of +the sequence. + +Omitting the type or using BOOST_FUSION_ADAPT_AUTO can be used to infer the type, +as with decltype. The macros should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be converted. @@ -391,8 +418,14 @@ namespace qualified name of the struct to be converted. // referring to demo::employee BOOST_FUSION_ADAPT_STRUCT_NAMED( demo::employee, adapted_employee, - (std::string, name) - (int, age)) + name, + age) + + // When BOOST_PP_VARIADICS is missing : + BOOST_FUSION_ADAPT_STRUCT_NAMED( + demo::employee, adapted_employee, + (BOOST_FUSION_ADAPT_AUTO, name), + (BOOST_FUSION_ADAPT_AUTO, age)) [endsect] From bf66c12cdecc431af80fb2b2c073983d7c2f395a Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 25 Jun 2014 00:25:14 +0200 Subject: [PATCH 41/85] Fix the unit test of adapt_struct for consistency with other tests of the same kind. --- 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 406030dd..76019644 100644 --- a/test/sequence/adapt_struct.cpp +++ b/test/sequence/adapt_struct.cpp @@ -159,7 +159,7 @@ main() { // conversion from point to list point p = {5, 3, 3}; - list l(p); + list l(p); l = p; } From 34fac0c4491b6be9763f95ce6786cc4373c95028 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 25 Jun 2014 00:45:38 +0200 Subject: [PATCH 42/85] Fix ADAPT_*_C / ADAPT_*_C_BASE macros responsible. These macros are used to handle generation of boilerplate code or each member to add to the adapted sequence. And in the commit abff92ab657333252c9a7a9e00274de99d294d5c we changed the signature of these macros to handle generation of proxied object field type deduction, this change simply fix the related macros. --- include/boost/fusion/adapted/adt/adapt_adt.hpp | 7 ++++--- include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp | 2 +- .../boost/fusion/adapted/struct/adapt_assoc_struct.hpp | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/boost/fusion/adapted/adt/adapt_adt.hpp b/include/boost/fusion/adapted/adt/adapt_adt.hpp index 3be25b1e..88ab177c 100644 --- a/include/boost/fusion/adapted/adt/adapt_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_adt.hpp @@ -40,9 +40,10 @@ #define BOOST_FUSION_ADAPT_ADT_FILLER_0_END #define BOOST_FUSION_ADAPT_ADT_FILLER_1_END -#define BOOST_FUSION_ADAPT_ADT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \ - BOOST_FUSION_ADAPT_ADT_C_BASE( \ - TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 4) +#define BOOST_FUSION_ADAPT_ADT_C( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \ + BOOST_FUSION_ADAPT_ADT_C_BASE( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 4) #define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ diff --git a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp index 12bf6aa2..ff33ac59 100644 --- a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp @@ -44,7 +44,7 @@ #define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1_END #define BOOST_FUSION_ADAPT_ASSOC_ADT_C( \ - TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \ \ BOOST_FUSION_ADAPT_ADT_C_BASE(TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,5) \ \ diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index eca77d61..c0665ae6 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -43,10 +43,10 @@ #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE) \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,PREFIX,ATTRIBUTE) \ \ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, PREFIX, ATTRIBUTE, 3) \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, PREFIX, ATTRIBUTE, 3) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -57,10 +57,10 @@ }; #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, I, ATTRIBUTE) \ \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY,ATTRIBUTE) + TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,BOOST_PP_EMPTY,ATTRIBUTE) #define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \ TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \ From 17e49ba4488eb82e5f647e115785a2ddc9de7071 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 23 Jul 2014 00:36:07 +0200 Subject: [PATCH 43/85] Adds accessors for the wrapped attributes and provide preliminary support for type deduction to ADAPT_ASSOC* macros. --- .../adapted/struct/adapt_assoc_struct.hpp | 21 +++++++------ .../fusion/adapted/struct/adapt_struct.hpp | 5 +-- .../adapted/struct/detail/adapt_base.hpp | 12 ++++--- .../struct/detail/adapt_base_attr_filler.hpp | 31 +++++++++++++++++++ 4 files changed, 53 insertions(+), 16 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index c0665ae6..1de7efe3 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -35,25 +36,27 @@ #include #include -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ - ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \ - ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END - #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \ TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,PREFIX,ATTRIBUTE) \ \ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ - TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, PREFIX, ATTRIBUTE, 3) \ + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + IS_VIEW, \ + I, \ + PREFIX, \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ + BOOST_PP_IF(BOOST_PP_LESS( \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),3), 1, 0)) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ > \ struct struct_assoc_key \ { \ - typedef BOOST_PP_TUPLE_ELEM(3, 2, ATTRIBUTE) type; \ + typedef \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) type; \ }; #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C( \ diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 9c1d19f1..09c9015a 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -43,10 +43,11 @@ I, \ BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE), \ - BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE)) + BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE), \ + BOOST_PP_IF( \ + BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE),2), 1, 0)) -#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() #if BOOST_PP_VARIADICS diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 26051395..ce92db05 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -35,6 +35,8 @@ #include +#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() + #define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \ BOOST_PP_SEQ_HEAD(SEQ) \ BOOST_PP_EMPTY() @@ -124,7 +126,8 @@ #define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW, \ - I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ + I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, \ + DEDUCE_TYPE) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -135,7 +138,7 @@ > \ { \ typedef \ - BOOST_PP_IF(BOOST_PP_LESS(ATTRIBUTE_TUPEL_SIZE,2), \ + BOOST_PP_IF(DEDUCE_TYPE, \ BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE \ )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ attribute_type; \ @@ -163,8 +166,7 @@ { \ return seq.PREFIX() \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ - BOOST_PP_IF(BOOST_PP_LESS(ATTRIBUTE_TUPEL_SIZE,2), 0, 1),\ - ATTRIBUTE); \ + BOOST_PP_IF(DEDUCE_TYPE, 0, 1), ATTRIBUTE); \ } \ }; \ }; \ @@ -185,7 +187,7 @@ { \ return BOOST_PP_STRINGIZE( \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ - BOOST_PP_IF(BOOST_PP_LESS(ATTRIBUTE_TUPEL_SIZE,2), 0, 1),\ + BOOST_PP_IF(DEDUCE_TYPE, 0, 1), \ ATTRIBUTE)); \ } \ }; 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 4ad03a26..4214d9ac 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 @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -34,6 +35,36 @@ ((2, (X,Y))) \ ) +#define BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE) + +#define BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE) + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ + BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ + ((2, (Y,Z))), \ + ((3, (X,Y,Z))) \ + ) + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM( \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ + BOOST_PP_SUB(BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE)) + + #if BOOST_PP_VARIADICS # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, data, elem) \ From 5422ba7f8f9a450001513f84035cfd83d39992a1 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 23 Jul 2014 02:42:30 +0200 Subject: [PATCH 44/85] Adds the possibility to omit the member type in ADAPT_ASSOC* macros usage. This feature is enabled when BOOST_PP_VARIADICS also is, as it rely on it. A placeholder for the type can be used when BOOST_PP_VARIADICS isn't active. --- .../adapted/struct/adapt_assoc_struct.hpp | 3 +- .../detail/adapt_base_assoc_attr_filler.hpp | 62 +++++++++++++++++++ .../struct/detail/adapt_base_attr_filler.hpp | 34 ++-------- test/sequence/adapt_assoc_struct.cpp | 20 ++++-- 4 files changed, 84 insertions(+), 35 deletions(-) create mode 100644 include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index 1de7efe3..eab4e1bb 100644 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -65,6 +65,7 @@ BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \ TEMPLATE_PARAMS_SEQ,NAME_SEQ,IS_VIEW,I,BOOST_PP_EMPTY,ATTRIBUTE) + #define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \ TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \ \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp new file mode 100644 index 00000000..494bc064 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp @@ -0,0 +1,62 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP + +#include + +#include + +#include +#include +#include +#include +#include + +#if BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(...) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(...) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) + +#else + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ + BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ + ((2, (Y,Z))), \ + ((3, (X,Y,Z))) \ + ) + +#endif + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END + + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM( \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ + BOOST_PP_SUB(BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE)) + +#endif 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 4214d9ac..096cc1b9 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 @@ -12,12 +12,13 @@ #include #include -#include +#include #include #include #include #include + #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X,Y) \ BOOST_FUSION_ADAPT_STRUCT_FILLER_1 @@ -41,46 +42,21 @@ #define BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE) \ BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE) -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 - -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 - -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END - -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ - BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ - ((2, (Y,Z))), \ - ((3, (X,Y,Z))) \ - ) - -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \ - BOOST_PP_TUPLE_ELEM( \ - BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ - BOOST_PP_SUB(BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \ - BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE)) - #if BOOST_PP_VARIADICS -# define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER_OP(r, data, elem) \ +# 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_ATTRIBUTE_FILLER(BOOST_FUSION_ADAPT_AUTO, \ - elem) \ - ) + elem)) # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(...) \ 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__)), \ - (0,0) \ - ) + (0,0)) #endif // BOOST_PP_VARIADICS diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index 62574a7e..e114f377 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -50,11 +50,21 @@ namespace ns }; } -BOOST_FUSION_ADAPT_ASSOC_STRUCT( - ns::point, - (int, x, ns::x_member) - (int, y, ns::y_member) -) +#if BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ASSOC_STRUCT( + ns::point, + (x, ns::x_member) + (int, y, ns::y_member) + ) + +#else // BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ASSOC_STRUCT( + ns::point, + (BOOST_FUSION_ADAPT_AUTO, x, ns::x_member) + (int, y, ns::y_member) + ) + +#endif int main() From a5d6fd0800766a18805ae336ca9529ac451ee122 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 23 Jul 2014 02:49:28 +0200 Subject: [PATCH 45/85] Test adapt_assoc_tpl_struct checking support for type deduction. --- test/sequence/adapt_assoc_tpl_struct.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index a327f9e8..ad4c19f4 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -47,12 +47,22 @@ namespace ns }; } -BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( - (X)(Y), - (ns::point)(X)(Y), - (int, x, ns::x_member) - (int, y, ns::y_member) -) +#if BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( + (X)(Y), + (ns::point)(X)(Y), + (x, ns::x_member) + (y, ns::y_member) + ) + +#else // BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( + (X)(Y), + (ns::point)(X)(Y), + (int, x, ns::x_member) + (BOOST_FUSION_ADAPT_AUTO, y, ns::y_member) + ) +#endif int main() From a13d1346f6aae0bb994fe299496ada62067bb63d Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 27 Jul 2014 15:51:12 +0200 Subject: [PATCH 46/85] Adapted tests of assoc_struct to the type-deducing version of the ADAPT* macros. --- test/sequence/adapt_assoc_struct.cpp | 45 ++++++++++++++++++---------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp index e114f377..4cdabb87 100644 --- a/test/sequence/adapt_assoc_struct.cpp +++ b/test/sequence/adapt_assoc_struct.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -42,11 +43,13 @@ namespace ns struct x_member; struct y_member; struct z_member; + struct non_member; struct point { int x; int y; + int z; }; } @@ -54,14 +57,16 @@ namespace ns BOOST_FUSION_ADAPT_ASSOC_STRUCT( ns::point, (x, ns::x_member) - (int, y, ns::y_member) + (y, ns::y_member) + (int, z, ns::z_member) ) #else // BOOST_PP_VARIADICS BOOST_FUSION_ADAPT_ASSOC_STRUCT( ns::point, (BOOST_FUSION_ADAPT_AUTO, x, ns::x_member) - (int, y, ns::y_member) + (BOOST_FUSION_ADAPT_AUTO, y, ns::y_member) + (int, z, ns::z_member) ) #endif @@ -78,28 +83,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p = {123, 456}; + ns::point p = {123, 456, 789}; std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2); - ns::point v2 = {5, 3}; - fusion::vector v3(5, 4); + fusion::vector v1(4, 2, 2); + ns::point v2 = {5, 3, 3}; + fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -112,15 +119,15 @@ main() { // conversion from ns::point to vector - ns::point p = {5, 3}; - fusion::vector v(p); + ns::point p = {5, 3, 3}; + fusion::vector v(p); v = p; } { // conversion from ns::point to list - ns::point p = {5, 3}; - fusion::list l(p); + ns::point p = {5, 3, 3}; + fusion::list l(p); l = p; } @@ -128,15 +135,18 @@ main() // assoc stuff BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((mpl::not_ >)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); - ns::point p = {5, 3}; + ns::point p = {5, 3, 9}; BOOST_TEST(at_key(p) == 5); BOOST_TEST(at_key(p) == 3); + BOOST_TEST(at_key(p) == 9); } { @@ -144,6 +154,9 @@ main() BOOST_MPL_ASSERT((boost::is_same< boost::fusion::result_of::value_at_c::type , mpl::front::type>)); + BOOST_MPL_ASSERT((boost::is_same< + boost::fusion::result_of::value_at_c::type + , mpl::back::type>)); } return boost::report_errors(); From 4b0bed40f7bf0359cf5f4c50a8e1cff81ebb2ead Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 27 Jul 2014 16:07:47 +0200 Subject: [PATCH 47/85] Renamed macro wrapping attribute to a more descriptive name. --- .../struct/detail/adapt_base_assoc_attr_filler.hpp | 12 ++++++------ .../adapted/struct/detail/adapt_base_attr_filler.hpp | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp index 494bc064..725af756 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp @@ -21,27 +21,27 @@ #if BOOST_PP_VARIADICS #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(...) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(__VA_ARGS__) \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(...) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(__VA_ARGS__) \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(...) \ +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(...) \ ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) #else #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_ATTRIBUTE_FILLER(X, Y, Z) \ +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \ BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ ((2, (Y,Z))), \ ((3, (X,Y,Z))) \ 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 096cc1b9..ac3d90ad 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 @@ -20,17 +20,17 @@ #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ - BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X,Y) \ BOOST_FUSION_ADAPT_STRUCT_FILLER_1 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ - BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X,Y) \ + BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X,Y) \ BOOST_FUSION_ADAPT_STRUCT_FILLER_0 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END -#define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTE_FILLER(X, Y) \ +#define BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(X, Y) \ BOOST_PP_IF(BOOST_PP_IS_EMPTY(X), \ ((1, (Y))), \ ((2, (X,Y))) \ @@ -48,7 +48,7 @@ # 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_ATTRIBUTE_FILLER(BOOST_FUSION_ADAPT_AUTO, \ + BOOST_FUSION_ADAPT_STRUCT_WRAP_ATTR(BOOST_FUSION_ADAPT_AUTO, \ elem)) # define BOOST_FUSION_ADAPT_STRUCT_ATTRIBUTES_FILLER(...) \ From a54c543dd7aa96686a58b467bacb4b43735afeab Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 27 Jul 2014 16:31:15 +0200 Subject: [PATCH 48/85] Adapted test cases for adapt_assoc_tpl_struct with type deduction. --- test/sequence/adapt_assoc_tpl_struct.cpp | 56 ++++++++++++++---------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/test/sequence/adapt_assoc_tpl_struct.cpp b/test/sequence/adapt_assoc_tpl_struct.cpp index ad4c19f4..6adcc931 100644 --- a/test/sequence/adapt_assoc_tpl_struct.cpp +++ b/test/sequence/adapt_assoc_tpl_struct.cpp @@ -39,28 +39,33 @@ namespace ns struct y_member; struct z_member; - template + struct non_member; + + template struct point { X x; Y y; + Z z; }; } #if BOOST_PP_VARIADICS BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( - (X)(Y), - (ns::point)(X)(Y), - (x, ns::x_member) - (y, ns::y_member) + (X)(Y)(Z), + (ns::point)(X)(Y)(Z), + (int, x, ns::x_member) + (Y, y, ns::y_member) + (z, ns::z_member) ) #else // BOOST_PP_VARIADICS BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( - (X)(Y), - (ns::point)(X)(Y), + (X)(Y)(Z), + (ns::point)(X)(Y)(Z), (int, x, ns::x_member) - (BOOST_FUSION_ADAPT_AUTO, y, ns::y_member) + (Y, y, ns::y_member) + (BOOST_FUSION_ADAPT_AUTO, z, ns::z_member) ) #endif @@ -69,7 +74,7 @@ main() { using namespace boost::fusion; - typedef ns::point point; + typedef ns::point point; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -77,28 +82,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - point p = {123, 456}; + point p = {123, 456, 789.43f}; std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789.43f)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - vector v1(4, 2); - point v2 = {5, 3}; - vector v3(5, 4); + vector v1(4, 2, 2); + point v2 = {5, 3, 3}; + vector v3(5, 4, 4.13f); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -111,15 +118,15 @@ main() { // conversion from point to vector - point p = {5, 3}; - vector v(p); + point p = {5, 3, 3}; + vector v(p); v = p; } { // conversion from point to list - point p = {5, 3}; - list l(p); + point p = {5, 3, 3}; + list l(p); l = p; } @@ -127,15 +134,18 @@ main() // assoc stuff BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, float>)); - point p = {5, 3}; + point p = {5, 3, 9}; BOOST_TEST(at_key(p) == 5); BOOST_TEST(at_key(p) == 3); + BOOST_TEST(at_key(p) == 9); } return boost::report_errors(); From fcb579f208dc69b9811ae64ab80181478a508191 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 27 Jul 2014 17:19:15 +0200 Subject: [PATCH 49/85] Documented BOOST_FUSION_ADAT_ASSOC* macros with type inference. --- doc/adapted.qbk | 82 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index 1b5c97c0..c11d733e 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -193,7 +193,7 @@ __random_access_sequence__. ... ) - // When BOOST_PP_VARIADICS is missing : + // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_STRUCT( struct_name, (member_type0, member_name0) @@ -211,8 +211,8 @@ The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)` pairs declares the type and names of each of the struct members that are part of the sequence. -Omitting the type or using BOOST_FUSION_ADAPT_AUTO can be used to infer the type, -as with decltype. +When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +infered with Boost.TypeOf. The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -238,7 +238,7 @@ namespace qualified name of the struct to be adapted. name, age) - // When BOOST_PP_VARIADICS is missing : + // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_STRUCT( demo::employee, (BOOST_FUSION_ADAPT_AUTO, name) @@ -263,7 +263,7 @@ __random_access_sequence__. ... ) - // When BOOST_PP_VARIADICS is missing : + // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_TPL_STRUCT( (template_param0)(template_param1)..., (struct_name) (specialization_param0)(specialization_param1)..., @@ -287,8 +287,8 @@ The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)` pairs declares the type and names of each of the struct members that are part of the sequence. -Omitting the type or using BOOST_FUSION_ADAPT_AUTO can be used to infer the type, -as with decltype. +When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +infered with Boost.TypeOf. The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -355,7 +355,7 @@ adapted using the given name. ... ) - // When BOOST_PP_VARIADICS is missing : + // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_STRUCT_NAMED( struct_name, adapted_name, @@ -393,8 +393,8 @@ The sequence of `member_nameN,` arguments or `(member_typeN, member_nameN)` pairs declares the type and names of each of the struct members that are part of the sequence. -Omitting the type or using BOOST_FUSION_ADAPT_AUTO can be used to infer the type, -as with decltype. +When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +infered with Boost.TypeOf. The macros should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be converted. @@ -421,7 +421,7 @@ namespace qualified name of the struct to be converted. name, age) - // When BOOST_PP_VARIADICS is missing : + // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_STRUCT_NAMED( demo::employee, adapted_employee, (BOOST_FUSION_ADAPT_AUTO, name), @@ -439,8 +439,8 @@ __random_access_sequence__ and __associative_sequence__. [heading Synopsis] BOOST_FUSION_ADAPT_ASSOC_STRUCT( struct_name, - (member_type0, member_name0, key_type0) - (member_type1, member_name1, key_type1) + ([member_type0,] member_name0, key_type0) + ([member_type1,] member_name1, key_type1) ... ) @@ -448,10 +448,13 @@ __random_access_sequence__ and __associative_sequence__. The above macro generates the necessary code to adapt `struct_name` as a model of __random_access_sequence__ and __associative_sequence__. -The sequence of `(member_typeN, member_nameN, key_typeN)` -triples declares the type, name and key type of each of the struct members +The sequence of `([member_typeN,] member_nameN, key_typeN)` tuples +declares the type, name and key type of each of the struct members that are part of the sequence. +When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +infered with Boost.TypeOf. + The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -481,8 +484,14 @@ namespace qualified name of the struct to be adapted. // keys keys::name and keys::age present. BOOST_FUSION_ADAPT_ASSOC_STRUCT( demo::employee, - (std::string, name, keys::name) - (int, age, keys::age)) + (name, keys::name) + (age, keys::age)) + + // Without BOOST_PP_VARIADICS support : + BOOST_FUSION_ADAPT_ASSOC_STRUCT( + demo::employee, + (BOOST_FUSION_ADAPT_AUTO, name, keys::name), + (BOOST_FUSION_ADAPT_AUTO, age, keys::name)) [endsect] @@ -497,8 +506,8 @@ __random_access_sequence__ and __associative_sequence__. BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( (template_param0)(template_param1)..., (struct_name) (specialization_param0)(specialization_param1)..., - (member_type0, member_name0, key_type0) - (member_type1, member_name1, key_type1) + ([member_type0,] member_name0, key_type0) + ([member_type1,] member_name1, key_type1) ... ) @@ -512,10 +521,13 @@ the template type parameters used. The sequence `(specialization_param0)(specialization_param1)...` declares the template parameters of the actual specialization of `struct_name` that is adapted as a fusion sequence. -The sequence of `(member_typeN, member_nameN, key_typeN)` -triples declares the type, name and key type of each of the struct members +The sequence of `([member_typeN,] member_nameN, key_typeN)` +tuples declares the type, name and key type of each of the struct members that are part of the sequence. +When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +infered with Boost.TypeOf. + The macro should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be adapted. @@ -544,6 +556,13 @@ namespace qualified name of the struct to be adapted. // Any instantiated demo::employee is now a Fusion sequence. // It is also an associative sequence with // keys keys::name and keys::age present. + BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( + (Name)(Age), + (demo::employee) (Name)(Age), + (name, keys::name) + (age, keys::age)) + + // Without BOOST_PP_VARIADICS support : BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( (Name)(Age), (demo::employee) (Name)(Age), @@ -563,8 +582,8 @@ __associative_sequence__. The given struct is adapted using the given name. [heading Synopsis] BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( struct_name, adapted_name, - (member_type0, member_name0, key_type0) - (member_type1, member_name1, key_type1) + ([member_type0,] member_name0, key_type0) + ([member_type1,] member_name1, key_type1) ... ) @@ -572,8 +591,8 @@ __associative_sequence__. The given struct is adapted using the given name. struct_name, (namespace0)(namespace1)..., adapted_name, - (member_type0, member_name0, key_type0) - (member_type1, member_name1, key_type1) + ([member_type0,] member_name0, key_type0) + ([member_type1,] member_name1, key_type1) ... ) @@ -593,6 +612,9 @@ The sequence of `(member_typeN, member_nameN, key_typeN)` triples declares the type, name and key type of each of the struct members that are part of the sequence. +When member_typeN is omitted or set to BOOST_FUSION_ADAPT_AUTO, the type is +infered with Boost.TypeOf. + The macros should be used at global scope, and `struct_name` should be the fully namespace qualified name of the struct to be converted. @@ -621,8 +643,14 @@ namespace qualified name of the struct to be converted. // referring to demo::employee BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( demo::employee, adapted_employee, - (std::string, name, keys::name) - (int, age, keys::age)) + (name, keys::name) + (age, keys::age)) + + // Without BOOST_PP_VARIADICS support : + BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( + demo::employee, adapted_employee, + (BOOST_FUSION_ADAPT_AUTO, name, keys::name) + (BOOST_FUSION_ADAPT_AUTO, age, keys::age)) [endsect] From 047b0525480dc611e0ce27e279ba99197fceb649 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 29 Jul 2014 22:22:54 +0200 Subject: [PATCH 50/85] Add missing include. --- .../fusion/adapted/struct/detail/adapt_base_attr_filler.hpp | 1 + 1 file changed, 1 insertion(+) 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 ac3d90ad..69d5b204 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 @@ -13,6 +13,7 @@ #include #include +#include #include #include #include From 0715e996e27d2d1a6547a83c1cde122330db9c6a Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 29 Jul 2014 22:24:23 +0200 Subject: [PATCH 51/85] Fix the DEFINE_ASSOC_STRUCT macros to use specific FILLER macros, because they cannot need type deduction. --- .../fusion/adapted/struct/define_assoc_struct.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/adapted/struct/define_assoc_struct.hpp b/include/boost/fusion/adapted/struct/define_assoc_struct.hpp index 1f5ce8dc..f4a3679d 100644 --- a/include/boost/fusion/adapted/struct/define_assoc_struct.hpp +++ b/include/boost/fusion/adapted/struct/define_assoc_struct.hpp @@ -12,6 +12,13 @@ #include #include +#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ + ((X, Y, Z)) BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1 +#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1(X, Y, Z) \ + ((X, Y, Z)) BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0 +#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0_END +#define BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_1_END + #define BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT( \ TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ \ @@ -20,7 +27,7 @@ (0)NAMESPACE_SEQ, \ NAME, \ BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \ + BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \ 3) \ \ BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \ @@ -34,7 +41,7 @@ (0)NAMESPACE_SEQ, \ NAME, \ BOOST_PP_CAT( \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \ + BOOST_FUSION_DEFINE_ASSOC_STRUCT_FILLER_0(0,0,0)ATTRIBUTES,_END), \ 3) \ \ BOOST_FUSION_ADAPT_ASSOC_STRUCT( \ From c8e4172021f1a65b44738e8025df0a4af7a56d09 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 10 Aug 2014 15:11:34 +0200 Subject: [PATCH 52/85] Fix indentation. --- include/boost/fusion/adapted/struct/detail/adapt_base.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index ce92db05..1d054c46 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -64,13 +64,13 @@ #define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ - BOOST_TYPEOF( \ - BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)::PREFIX() \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) + BOOST_TYPEOF( \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)::PREFIX() \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) #define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, unused) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS # define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ From fe3682ac0202faef7b4cede7fa15dc6195a640e5 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 10 Aug 2014 15:15:31 +0200 Subject: [PATCH 53/85] add type deduction support to BOOST_FUSION_ADAPT_ADT_C_BASE. --- .../boost/fusion/adapted/adt/adapt_adt.hpp | 8 ++- .../fusion/adapted/adt/detail/adapt_base.hpp | 51 ++++++++++++++++--- 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/include/boost/fusion/adapted/adt/adapt_adt.hpp b/include/boost/fusion/adapted/adt/adapt_adt.hpp index 88ab177c..fd91541a 100644 --- a/include/boost/fusion/adapted/adt/adapt_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_adt.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,12 @@ #define BOOST_FUSION_ADAPT_ADT_C( \ TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \ BOOST_FUSION_ADAPT_ADT_C_BASE( \ - TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 4) + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + I, \ + ATTRIBUTE, \ + 4, \ + BOOST_PP_BOOL(0)) #define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 3de396dd..b155fc3c 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -16,6 +16,8 @@ #include #include #include +#include +#include #define BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ) \ typename detail::get_identity< \ @@ -28,8 +30,27 @@ \ boost::remove_const::type>::type +#define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ + \ + struct deduced_attr_type { \ + const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ + typedef BOOST_TYPEOF( \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE)) type; \ + }; \ + \ + typedef remove_const::type type; \ + typedef add_const::type const_type; + +#define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ + \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) const_type; + + #define BOOST_FUSION_ADAPT_ADT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -39,6 +60,12 @@ , I \ > \ { \ + \ + BOOST_PP_IF(DEDUCE_TYPE, \ + BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF, \ + BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE \ + )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) /* XXX: Check PREFIX */\ + \ template \ BOOST_FUSION_GPU_ENABLED \ static void \ @@ -50,7 +77,7 @@ } \ \ BOOST_FUSION_GPU_ENABLED \ - static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ + static type /* TODO: Check Type here */ \ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ { \ @@ -58,7 +85,7 @@ } \ \ BOOST_FUSION_GPU_ENABLED \ - static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \ + static const_type /* TODO: check Const Type here */ \ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ { \ @@ -75,7 +102,10 @@ , true \ > \ { \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) type; \ + typedef access::adt_attribute_access< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + >::const_type type; /* TODO: check const Type here */ \ \ BOOST_FUSION_GPU_ENABLED \ explicit \ @@ -111,7 +141,10 @@ , false \ > \ { \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ + typedef access::adt_attribute_access< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + >::type type; /* TODO: check Type here */ \ \ BOOST_FUSION_GPU_ENABLED \ explicit \ @@ -158,7 +191,13 @@ , I \ > \ { \ - typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \ + typedef \ + adt_attribute_proxy< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + , false \ + > lvalue; \ + \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ \ From 52d280983b318cbddcc565d2dde120f0f31f10d1 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 10 Aug 2014 15:27:55 +0200 Subject: [PATCH 54/85] Fix some includes for consistency and use correct accessors macros. Since we have accessors macros for wrapped attributes we better use them, to improve readability of the macros. --- include/boost/fusion/adapted/struct/adapt_struct.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index 09c9015a..e9d14b74 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include #include #include @@ -42,10 +44,12 @@ IS_VIEW, \ I, \ BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ - BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE), \ - BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE), \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR(ATTRIBUTE), \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_PP_IF( \ - BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE),2), 1, 0)) + BOOST_PP_LESS( \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),2) \ + , 1, 0)) From 7b089aa589fe47fac5b02b12e6a11f9b53f95594 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 10 Aug 2014 17:09:57 +0200 Subject: [PATCH 55/85] Add support for BOOST_FUSION_ADAPT_ADT to either deduce types or use specified ones. --- .../boost/fusion/adapted/adt/adapt_adt.hpp | 22 +++++++-------- .../fusion/adapted/adt/detail/adapt_base.hpp | 28 +++++++++++++++---- .../fusion/adapted/struct/adapt_struct.hpp | 2 +- .../adapted/struct/detail/adapt_auto.hpp | 15 ++++++++++ .../adapted/struct/detail/adapt_base.hpp | 2 +- test/sequence/adapt_adt.cpp | 4 +-- 6 files changed, 53 insertions(+), 20 deletions(-) create mode 100644 include/boost/fusion/adapted/struct/detail/adapt_auto.hpp diff --git a/include/boost/fusion/adapted/adt/adapt_adt.hpp b/include/boost/fusion/adapted/adt/adapt_adt.hpp index fd91541a..37781765 100644 --- a/include/boost/fusion/adapted/adt/adapt_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_adt.hpp @@ -2,6 +2,7 @@ Copyright (c) 2001-2009 Joel de Guzman Copyright (c) 2009-2010 Hartmut Kaiser Copyright (c) 2010-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl 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) @@ -13,7 +14,9 @@ #include #include #include -#include +#include +#include +#include #include #include #include @@ -33,13 +36,7 @@ #include #include #include - -#define BOOST_FUSION_ADAPT_ADT_FILLER_0(A, B, C, D)\ - ((A, B, C, D)) BOOST_FUSION_ADAPT_ADT_FILLER_1 -#define BOOST_FUSION_ADAPT_ADT_FILLER_1(A, B, C, D)\ - ((A, B, C, D)) BOOST_FUSION_ADAPT_ADT_FILLER_0 -#define BOOST_FUSION_ADAPT_ADT_FILLER_0_END -#define BOOST_FUSION_ADAPT_ADT_FILLER_1_END +#include #define BOOST_FUSION_ADAPT_ADT_C( \ TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \ @@ -47,9 +44,12 @@ TEMPLATE_PARAMS_SEQ, \ NAME_SEQ, \ I, \ - ATTRIBUTE, \ - 4, \ - BOOST_PP_BOOL(0)) + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ + BOOST_PP_IF( \ + BOOST_PP_LESS( \ + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 4) \ + , 1, 0)) #define BOOST_FUSION_ADAPT_TPL_ADT(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES) \ BOOST_FUSION_ADAPT_STRUCT_BASE( \ diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index b155fc3c..9979c608 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -11,6 +11,8 @@ #define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_HPP #include +#include + #include #include #include @@ -19,6 +21,8 @@ #include #include +#include + #define BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ) \ typename detail::get_identity< \ lvalue \ @@ -30,13 +34,24 @@ \ boost::remove_const::type>::type +#define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + BOOST_PP_IF(DEDUCE_TYPE, 0, 2), ATTRIBUTE) + +#define BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE) + #define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ \ struct deduced_attr_type { \ const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ typedef BOOST_TYPEOF( \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE)) type; \ + BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ + ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ }; \ \ typedef remove_const::type type; \ @@ -64,7 +79,7 @@ BOOST_PP_IF(DEDUCE_TYPE, \ BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF, \ BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE \ - )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) /* XXX: Check PREFIX */\ + )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) /* XXX: Check PROXY PREFIX */\ \ template \ BOOST_FUSION_GPU_ENABLED \ @@ -73,7 +88,8 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj, \ Val const& val) \ { \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \ + BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ } \ \ BOOST_FUSION_GPU_ENABLED \ @@ -81,7 +97,8 @@ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ { \ - return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ + return BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ } \ \ BOOST_FUSION_GPU_ENABLED \ @@ -89,7 +106,8 @@ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ { \ - return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ + return BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ } \ }; \ \ diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp index e9d14b74..e96e7c76 100644 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -48,7 +48,7 @@ BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_PP_IF( \ BOOST_PP_LESS( \ - BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE),2) \ + BOOST_FUSION_ADAPT_STRUCT_WRAPPEDATTR_SIZE(ATTRIBUTE), 2) \ , 1, 0)) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp b/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp new file mode 100644 index 00000000..5178150b --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/adapt_auto.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_AUTO_HPP + +#include + +#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 1d054c46..dc6ec3ce 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -35,7 +36,6 @@ #include -#define BOOST_FUSION_ADAPT_AUTO BOOST_PP_EMPTY() #define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \ BOOST_PP_SEQ_HEAD(SEQ) \ diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index d4f4a8c2..5055ce04 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -93,8 +93,8 @@ namespace ns BOOST_FUSION_ADAPT_ADT( ns::point, - (int, int, obj.get_x(), obj.set_x(val)) - (int, int, obj.get_y(), obj.set_y(val)) + (obj.get_x(), obj.set_x(val)) + (obj.get_y(), obj.set_y(val)) ) #if !BOOST_WORKAROUND(__GNUC__,<4) From 727f49b49ed1aa6b5b544e40e09a18f55951eaf5 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 26 Aug 2014 22:00:16 +0200 Subject: [PATCH 56/85] Improve adapt_adt test to check more case with type deduction. --- test/sequence/adapt_adt.cpp | 124 ++++++++++++++++++++++++------------ 1 file changed, 83 insertions(+), 41 deletions(-) diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index 5055ce04..f2b15b1f 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -38,18 +38,21 @@ namespace ns { public: - point() : x(0), y(0) {} - point(int in_x, int in_y) : x(in_x), y(in_y) {} + point() : x(0), y(0), z(0) {} + point(int in_x, int in_y, int in_z) : x(in_x), y(in_y), z(in_z) {} int get_x() const { return x; } int get_y() const { return y; } + int get_z() const { return z; } void set_x(int x_) { x = x_; } void set_y(int y_) { y = y_; } + void set_z(int z_) { z = z_; } private: int x; int y; + int z; }; #if !BOOST_WORKAROUND(__GNUC__,<4) @@ -58,17 +61,22 @@ namespace ns friend struct boost::fusion::extension::access; public: - point_with_private_members() : x(0), y(0) {} - point_with_private_members(int x, int y) : x(x), y(y) {} - - private: + point_with_private_members() : x(0), y(0), z(0) {} + point_with_private_members(int in_x, int in_y, int in_z) + : x(in_x), y(in_y), z(in_z) {} + int get_x() const { return x; } int get_y() const { return y; } + int get_z() const { return z; } void set_x(int x_) { x = x_; } void set_y(int y_) { y = y_; } - + void set_z(int z_) { z = z_; } + + private: + int x; int y; + int z; }; #endif @@ -91,26 +99,56 @@ namespace ns }; } -BOOST_FUSION_ADAPT_ADT( - ns::point, - (obj.get_x(), obj.set_x(val)) - (obj.get_y(), obj.set_y(val)) -) +#if BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ADT( + ns::point, + (int, int, obj.get_x(), obj.set_x(val)) + (obj.get_y(), obj.set_y(val)) + (obj.get_z(), obj.set_z(val)) + ) + +# if !BOOST_WORKAROUND(__GNUC__,<4) + BOOST_FUSION_ADAPT_ADT( + ns::point_with_private_members, + (obj.get_x(), obj.set_x(val)) + (obj.get_y(), obj.set_y(val)) + (obj.get_z(), obj.set_z(val)) + ) +# endif + + + BOOST_FUSION_ADAPT_ADT( + ns::name, + (obj.get_last(), obj.set_last(val)) + (obj.get_first(), obj.set_first(val)) + ) + + +#else // BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ADT( + ns::point, + (int, int, obj.get_x(), obj.set_x(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) + ) + +# if !BOOST_WORKAROUND(__GNUC__,<4) + BOOST_FUSION_ADAPT_ADT( + ns::point_with_private_members, + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_x(), obj.set_x(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) + ) +# endif + + BOOST_FUSION_ADAPT_ADT( + ns::name, + (const std::string&, const std::string&, obj.get_last(), obj.set_last(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_first(), obj.set_first(val)) + ) -#if !BOOST_WORKAROUND(__GNUC__,<4) -BOOST_FUSION_ADAPT_ADT( - ns::point_with_private_members, - (int, int, obj.get_x(), obj.set_x(val)) - (int, int, obj.get_y(), obj.set_y(val)) -) #endif -BOOST_FUSION_ADAPT_ADT( - ns::name, - (const std::string&, const std::string&, obj.get_last(), obj.set_last(val)) - (const std::string&, const std::string&, obj.get_first(), obj.set_first(val)) -) - int main() { @@ -123,28 +161,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p(123, 456); + ns::point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2); - ns::point v2(5, 3); - fusion::vector v3(5, 4); + fusion::vector v1(4, 2, 2); + ns::point v2(5, 3, 3); + fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -171,15 +211,15 @@ main() { // conversion from ns::point to vector - ns::point p(5, 3); - fusion::vector v(p); + ns::point p(5, 3, 3); + fusion::vector v(p); v = p; } { // conversion from ns::point to list - ns::point p(5, 3); - fusion::list l(p); + ns::point p(5, 3, 3); + fusion::list l(p); l = p; } @@ -193,22 +233,24 @@ main() #if !BOOST_WORKAROUND(__GNUC__,<4) { BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point_with_private_members p(123, 456); + ns::point_with_private_members p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } #endif From f0bc2a2ac17ef4f9511931fb53b303a0f1a2a12d Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 26 Aug 2014 23:32:26 +0200 Subject: [PATCH 57/85] Fix dependents scopes and typedefs with typename keywords. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 13 ++-- test/sequence/adapt_tpl_adt.cpp | 66 ++++++++++++------- 2 files changed, 52 insertions(+), 27 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 9979c608..8512d04a 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -54,8 +54,13 @@ ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ }; \ \ - typedef remove_const::type type; \ - typedef add_const::type const_type; + typedef typename boost::remove_const< \ + typename deduced_attr_type::type \ + >::type type; \ + \ + typedef typename boost::add_const< \ + typename deduced_attr_type::type \ + >::type const_type; #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ @@ -120,7 +125,7 @@ , true \ > \ { \ - typedef access::adt_attribute_access< \ + typedef typename access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ >::const_type type; /* TODO: check const Type here */ \ @@ -159,7 +164,7 @@ , false \ > \ { \ - typedef access::adt_attribute_access< \ + typedef typename access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ >::type type; /* TODO: check Type here */ \ diff --git a/test/sequence/adapt_tpl_adt.cpp b/test/sequence/adapt_tpl_adt.cpp index aeb0f721..bbd1d07f 100644 --- a/test/sequence/adapt_tpl_adt.cpp +++ b/test/sequence/adapt_tpl_adt.cpp @@ -39,27 +39,45 @@ namespace ns { public: - point() : x(0), y(0) {} - point(X x_, Y y_) : x(x_), y(y_) {} + point() : x(0), y(0), z(0) {} + point(X x_, Y y_, int z_) : x(x_), y(y_), z(z_) {} X get_x() const { return x; } Y get_y() const { return y; } + int get_z() const { return z; } void set_x(X x_) { x = x_; } void set_y(Y y_) { y = y_; } + void set_z(int z_) { z = z_; } private: X x; Y y; + int z; }; } -BOOST_FUSION_ADAPT_TPL_ADT( - (X)(Y), - (ns::point)(X)(Y), - (X, X, obj.get_x(), obj.set_x(val)) - (Y, Y, obj.get_y(), obj.set_y(val)) -) + +#if BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_TPL_ADT( + (X)(Y), + (ns::point)(X)(Y), + (X, X, obj.get_x(), obj.set_x(val)) + (Y, Y, obj.get_y(), obj.set_y(val)) + (obj.get_z(), obj.set_z(val)) + ) + +#else // BOOST_PP_VARIADICS + + BOOST_FUSION_ADAPT_TPL_ADT( + (X)(Y), + (ns::point)(X)(Y), + (X, X, obj.get_x(), obj.set_x(val)) + (Y, Y, obj.get_y(), obj.set_y(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) + ) +#endif int main() @@ -75,28 +93,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - point p(123, 456); + point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - boost::fusion::vector v1(4, 2); - point v2(5, 3); - boost::fusion::vector v3(5, 4); + boost::fusion::vector v1(4, 2, 2); + point v2(5, 3, 3); + boost::fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -108,9 +128,9 @@ main() } { - boost::fusion::vector v1("Lincoln", "Abraham"); - name v2("Roosevelt", "Franklin"); - name v3("Roosevelt", "Theodore"); + boost::fusion::vector v1("Lincoln", "Abraham", 3); + name v2("Roosevelt", "Franklin", 3); + name v3("Roosevelt", "Theodore", 3); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -123,15 +143,15 @@ main() { // conversion from point to vector - point p(5, 3); - boost::fusion::vector v(p); + point p(5, 3, 3); + boost::fusion::vector v(p); v = p; } { // conversion from point to list - point p(5, 3); - boost::fusion::list l(p); + point p(5, 3, 3); + boost::fusion::list l(p); l = p; } From 69e67cd1adddc1e36e2a3f6a2b7b261ed3571454 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 17 Sep 2014 00:47:52 +0200 Subject: [PATCH 58/85] BUGFIX: When VARIADICS are active supporting any of the input combination. That is : BOOST_FUSION_ADAPT_AUTO, omitting type or specifying type. --- .../adt/detail/adapt_base_attr_filler.hpp | 84 +++++++++++++++++++ test/sequence/adapt_adt.cpp | 4 +- 2 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp new file mode 100644 index 00000000..e88d7f1e --- /dev/null +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp @@ -0,0 +1,84 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP +#define BOOST_FUSION_ADAPTED_ADT_DETAIL_ADAPT_BASE_ATTR_FILLER_HPP + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + + +#define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE) + +#define BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE) + +#if BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_ADT_FILLER_0(...) \ + BOOST_FUSION_ADAPT_ADT_FILLER(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ADT_FILLER_1 + +# define BOOST_FUSION_ADAPT_ADT_FILLER_1(...) \ + BOOST_FUSION_ADAPT_ADT_FILLER(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ADT_FILLER_0 + +# define BOOST_FUSION_ADAPT_ADT_FILLER_0_END +# define BOOST_FUSION_ADAPT_ADT_FILLER_1_END + +# define BOOST_FUSION_ADAPT_ADT_FILLER(...) \ + BOOST_PP_IF( \ + BOOST_PP_OR( \ + BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(0, __VA_ARGS__)), \ + BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__))), \ + BOOST_FUSION_ADAPT_ADT_WRAP_ATTR( \ + BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__), \ + BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REST_N(3, \ + BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))) ), \ + BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(__VA_ARGS__)) + +# define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) + +#else // BOOST_PP_VARIADICS + +# define BOOST_FUSION_ADAPT_ADT_FILLER_0(A, B, C, D) \ + BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A,B,C,D) \ + BOOST_FUSION_ADAPT_ADT_FILLER_1 + +# define BOOST_FUSION_ADAPT_ADT_FILLER_1(A, B, C, D) \ + BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A,B,C,D) \ + BOOST_FUSION_ADAPT_ADT_FILLER_0 + +# define BOOST_FUSION_ADAPT_ADT_FILLER_0_END +# define BOOST_FUSION_ADAPT_ADT_FILLER_1_END + +# define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(A, B, C, D) \ + BOOST_PP_IF(BOOST_PP_IS_EMPTY(A), \ + ((2, (C,D))), \ + ((4, (A,B,C,D))) \ + ) + +#endif // BOOST_PP_VARIADICS + +#endif diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index f2b15b1f..3a08000f 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -102,9 +102,9 @@ namespace ns #if BOOST_PP_VARIADICS BOOST_FUSION_ADAPT_ADT( ns::point, - (int, int, obj.get_x(), obj.set_x(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_x(), obj.set_x(val)) (obj.get_y(), obj.set_y(val)) - (obj.get_z(), obj.set_z(val)) + (int, int, obj.get_z(), obj.set_z(val)) ) # if !BOOST_WORKAROUND(__GNUC__,<4) From aa7b0a697229305f12d89ba3f17b4ce9f909519d Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 23 Sep 2014 23:07:00 +0200 Subject: [PATCH 59/85] Factoring out the workaround to access last variadic parameter. Indeed when some parameter are BOOST_PP_EMPTY the last parameter is accessed correctly but results in a compilation error which doesn't stop some compiler (e.g. g++) to go through the preprocessing pass and still compile the binary correctly. But to avoid the error message I used a workaround which behaves better. I preferred factoring it out to make clear that there are some reason why this element is strangely accessed. --- .../adapted/adt/detail/adapt_base_attr_filler.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp index e88d7f1e..09bd4014 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_attr_filler.hpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -53,13 +54,18 @@ BOOST_PP_IS_EMPTY(BOOST_PP_VARIADIC_ELEM(1, __VA_ARGS__))), \ BOOST_FUSION_ADAPT_ADT_WRAP_ATTR( \ BOOST_PP_VARIADIC_ELEM(2, __VA_ARGS__), \ - BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REST_N(3, \ - BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))) ), \ + BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(__VA_ARGS__) \ + ), \ BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(__VA_ARGS__)) # define BOOST_FUSION_ADAPT_ADT_WRAP_ATTR(...) \ ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) +# define BOOST_FUSION_WORKAROUND_VARIADIC_EMPTINESS_LAST_ELEM(...) \ + BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_REST_N( \ + BOOST_PP_SUB(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), 1), \ + BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))) + #else // BOOST_PP_VARIADICS # define BOOST_FUSION_ADAPT_ADT_FILLER_0(A, B, C, D) \ From c8ffc6498b12e0979ee3f216a91963f467555757 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 7 Oct 2014 21:39:18 +0200 Subject: [PATCH 60/85] add documentation for BOOST_FUSION_ADAPT_ADT and type deduction. --- doc/adapted.qbk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index c11d733e..8d6893ba 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -664,8 +664,8 @@ __random_access_sequence__. BOOST_FUSION_ADAPT_ADT( type_name, - (attribute_type0, attribute_const_type0, get_expr0, set_expr0) - (attribute_type1, attribute_const_type1, get_expr1, set_expr1) + ([attribute_type0, attribute_const_type0,] get_expr0, set_expr0) + ([attribute_type1, attribute_const_type1,] get_expr1, set_expr1) ... ) @@ -674,7 +674,7 @@ __random_access_sequence__. The above macro generates the necessary code to adapt `type_name` as a model of __random_access_sequence__. The sequence of -[^(attribute_type['N], attribute_const_type['N], get_expr['N], set_expr['N])] +[^([attribute_type['N], attribute_const_type['N],] get_expr['N], set_expr['N])] quadruples declares the types, const types, get-expressions and set-expressions of the elements that are part of the adapted fusion sequence. [^get_expr['N]] is the expression that is invoked to get the ['N]th element @@ -682,7 +682,9 @@ of an instance of `type_name`. This expression may access a variable named `obj` of type `type_name&` or `type_name const&` which represents the underlying instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types -that [^get_expr['N]] denotes to. +that [^get_expr['N]] denotes to, when omitted the type is deduced from +[get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for +variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. [^set_expr['N]] is the expression that is invoked to set the ['N]th element of an instance of `type_name`. This expression may access variables named `obj` of type `type_name&`, which represent the corresponding instance of From 103b02fda2d438350f0836af41e69bd49aed62fe Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 12 Oct 2014 12:50:56 +0200 Subject: [PATCH 61/85] add test for BOOST_FUSION_ADAPT_ADT_NAMED deducing types. --- test/sequence/adapt_adt_named.cpp | 48 ++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index 38415633..cdb4806f 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -37,28 +37,46 @@ namespace ns { public: - point() : x(0), y(0) {} - point(int in_x, int in_y) : x(in_x), y(in_y) {} + point() : x(0), y(0), z(0) {} + point(int in_x, int in_y, int in_z) : x(in_x), y(in_y), z(in_z) {} int get_x() const { return x; } int get_y() const { return y; } + int get_z() const { return z; } void set_x(int x_) { x = x_; } void set_y(int y_) { y = y_; } + void set_z(int z_) { z = z_; } private: int x; int y; + int z; }; } +#if BOOST_PP_VARIADICS + // this creates a fusion view: boost::fusion::adapted::point BOOST_FUSION_ADAPT_ADT_NAMED( ns::point, point, (int, int, obj.obj.get_x(), obj.obj.set_x(val)) (int, int, obj.obj.get_y(), obj.obj.set_y(val)) + (obj.obj.get_z(), obj.obj.set_z(val)) ) +#else // BOOST_PP_VARIADICS + +// this creates a fusion view: boost::fusion::adapted::point +BOOST_FUSION_ADAPT_ADT_NAMED( + ns::point, point, + (int, int, obj.obj.get_x(), obj.obj.set_x(val)) + (int, int, obj.obj.get_y(), obj.obj.set_y(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.obj.get_z(), obj.obj.set_z(val)) +) + +#endif // BOOST_PP_VARIADICS + int main() { @@ -71,31 +89,33 @@ main() { BOOST_MPL_ASSERT((traits::is_view)); - ns::point basep(123, 456); + ns::point basep(123, 456, 789); adapted::point p(basep); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - fusion::vector v1(4, 2); - ns::point basep(5, 3); + fusion::vector v1(4, 2, 2); + ns::point basep(5, 3, 3); adapted::point v2(basep); - fusion::vector v3(5, 4); + fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -108,19 +128,19 @@ main() { // conversion from ns::point to vector - ns::point basep(5, 3); + ns::point basep(5, 3, 3); adapted::point p(basep); - fusion::vector v(p); + fusion::vector v(p); v = p; } { // conversion from ns::point to list - ns::point basep(5, 3); + ns::point basep(5, 3, 3); adapted::point p(basep); - fusion::list l(p); + fusion::list l(p); l = p; } From 644d72ccfe8ec190c8c3f499bc85069568521142 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 12 Oct 2014 14:51:04 +0200 Subject: [PATCH 62/85] adds type deduction support for BOOST_FUSION_ADAPT_ASSOC_ADT. --- .../fusion/adapted/adt/adapt_assoc_adt.hpp | 22 ++++--- .../detail/adapt_base_assoc_attr_filler.hpp | 61 +++++++++++++++++++ test/sequence/adapt_assoc_adt.cpp | 56 ++++++++++++----- 3 files changed, 114 insertions(+), 25 deletions(-) create mode 100644 include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp diff --git a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp index ff33ac59..14eec414 100644 --- a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp @@ -2,6 +2,7 @@ Copyright (c) 2001-2009 Joel de Guzman Copyright (c) 2007 Dan Marsden Copyright (c) 2010-2011 Christopher Schmidt + Copyright (c) 2013-2014 Damien Buhl 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) @@ -35,25 +36,28 @@ #include #include #include - -#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(A, B, C, D, E)\ - ((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1 -#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(A, B, C, D, E)\ - ((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 -#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0_END -#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1_END +#include #define BOOST_FUSION_ADAPT_ASSOC_ADT_C( \ TEMPLATE_PARAMS_SEQ, NAME_SEQ, IS_VIEW, I, ATTRIBUTE) \ \ - BOOST_FUSION_ADAPT_ADT_C_BASE(TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,5) \ + BOOST_FUSION_ADAPT_ADT_C_BASE( \ + TEMPLATE_PARAMS_SEQ, \ + NAME_SEQ, \ + I, \ + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ + BOOST_PP_IF( \ + BOOST_PP_LESS( \ + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 5) \ + , 1, 0)) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ > \ struct struct_assoc_key \ { \ - typedef BOOST_PP_TUPLE_ELEM(5, 4, ATTRIBUTE) type; \ + typedef BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) type;\ }; #define BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( \ diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp new file mode 100644 index 00000000..b9c93b7d --- /dev/null +++ b/include/boost/fusion/adapted/adt/detail/adapt_base_assoc_attr_filler.hpp @@ -0,0 +1,61 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTER_ADT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP +#define BOOST_FUSION_ADAPTER_ADT_DETAIL_ADAPT_BASE_ASSOC_ATTR_FILLER_HPP + +#include + +#include + +#include +#include +#include +#include + +#if BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(...) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1 + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(...) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(__VA_ARGS__) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(...) \ + ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) + +#else // BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0(A, B, C, D, E) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1 + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1(A, B, C, D, E) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \ + BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0 + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAP_ATTR(A, B, C, D, E) \ + BOOST_PP_IF(BOOST_PP_IS_EMPTY(A), \ + ((3, (C,D,E))), \ + ((5, (A,B,C,D,E))) \ + ) + +#endif // BOOST_PP_VARIADICS + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_0_END +#define BOOST_FUSION_ADAPT_ASSOC_ADT_FILLER_1_END + + +#define BOOST_FUSION_ADAPT_ASSOC_ADT_WRAPPEDATTR_GET_KEY(ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM( \ + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ + BOOST_PP_SUB(BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), 1), \ + BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE)) + +#endif diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index c97e84b0..70d70ba4 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -26,31 +26,50 @@ namespace ns struct y_member; struct z_member; + struct unavailable_member; + class point { public: - point() : x(0), y(0) {} - point(int in_x, int in_y) : x(in_x), y(in_y) {} + point() : x(0), y(0), z(0) {} + point(int in_x, int in_y, int in_z) : x(in_x), y(in_y), z(in_z) {} int get_x() const { return x; } int get_y() const { return y; } + int get_z() const { return z; } void set_x(int x_) { x = x_; } void set_y(int y_) { y = y_; } + void set_z(int z_) { z = z_; } private: int x; int y; + int z; }; } +#if BOOST_PP_VARIADICS + BOOST_FUSION_ADAPT_ASSOC_ADT( ns::point, (int, int, obj.get_x(), obj.set_x(val), ns::x_member) (int, int, obj.get_y(), obj.set_y(val), ns::y_member) + (obj.get_z(), obj.set_z(val), ns::z_member) ) +#else // BOOST_PP_VARIADICS + +BOOST_FUSION_ADAPT_ASSOC_ADT( + ns::point, + (int, int, obj.get_x(), obj.set_x(val), ns::x_member) + (int, int, obj.get_y(), obj.set_y(val), ns::y_member) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val), ns::z_member) +) + +#endif + int main() { @@ -62,28 +81,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - ns::point p(123, 456); + ns::point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - boost::fusion::vector v1(4, 2); - ns::point v2(5, 3); - boost::fusion::vector v3(5, 4); + boost::fusion::vector v1(4, 2, 2); + ns::point v2(5, 3, 3); + boost::fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -96,15 +117,15 @@ main() { // conversion from ns::point to vector - ns::point p(5, 3); - boost::fusion::vector v(p); + ns::point p(5, 3, 3); + boost::fusion::vector v(p); v = p; } { // conversion from ns::point to list - ns::point p(5, 3); - boost::fusion::list l(p); + ns::point p(5, 3, 3); + boost::fusion::list l(p); l = p; } @@ -119,15 +140,18 @@ main() // assoc stuff BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); - ns::point p(5, 3); + ns::point p(5, 3, 1); BOOST_TEST(at_key(p) == 5); BOOST_TEST(at_key(p) == 3); + BOOST_TEST(at_key(p) == 1); } return boost::report_errors(); From cd0d3ce09ac75bb9545f959684d99996e72fb03e Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 12 Oct 2014 14:51:34 +0200 Subject: [PATCH 63/85] add comments for readability. --- .../adapted/struct/detail/adapt_base_assoc_attr_filler.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp index 725af756..c75e83c3 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base_assoc_attr_filler.hpp @@ -31,7 +31,8 @@ #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(...) \ ((BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), (__VA_ARGS__))) -#else +#else // BOOST_PP_VARIADICS + #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \ BOOST_FUSION_ADAPT_ASSOC_STRUCT_WRAP_ATTR(X, Y, Z) \ @@ -47,7 +48,7 @@ ((3, (X,Y,Z))) \ ) -#endif +#endif // BOOST_PP_VARIADICS #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END From 2b5da49628a22856c6939e568bf866d8d3fd5ae7 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 12 Oct 2014 16:25:59 +0200 Subject: [PATCH 64/85] lvalue access::struct_member was wrongly set to be adt_attribute_proxy<> instead of adt_attribute_proxy<>::type. Shame on me. --- include/boost/fusion/adapted/adt/detail/adapt_base.hpp | 2 +- test/sequence/adapt_assoc_adt.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 8512d04a..c304a4d1 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -219,7 +219,7 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ , false \ - > lvalue; \ + >::type lvalue; \ \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index 70d70ba4..220c4d8c 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -146,6 +146,7 @@ main() BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); ns::point p(5, 3, 1); From 03ba146d8473c3178bccc05c7d1abebbd393a850 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Mon, 20 Oct 2014 12:54:31 +0200 Subject: [PATCH 65/85] lvalue typedef for acess::struct_member is a dependent scope to templated parameter when used within BOOST_FUSION_ADAPT_ASSOC_TPL_ADT. This fixes test sequence/adapt_assoc_tpl_adt.cpp. --- include/boost/fusion/adapted/adt/detail/adapt_base.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index c304a4d1..80a62b3e 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -214,12 +214,12 @@ , I \ > \ { \ - typedef \ + typedef typename \ adt_attribute_proxy< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ , false \ - >::type lvalue; \ + >::type lvalue; \ \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ From cfcdbe119557f12044719a148680194cab3f27c8 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Mon, 20 Oct 2014 21:25:07 +0200 Subject: [PATCH 66/85] Change adapt_assoc_tpl_adt to test type inference from templated type. --- test/sequence/adapt_assoc_adt.cpp | 4 +-- test/sequence/adapt_assoc_tpl_adt.cpp | 51 ++++++++++++++++----------- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/test/sequence/adapt_assoc_adt.cpp b/test/sequence/adapt_assoc_adt.cpp index 220c4d8c..a03605f1 100644 --- a/test/sequence/adapt_assoc_adt.cpp +++ b/test/sequence/adapt_assoc_adt.cpp @@ -26,7 +26,7 @@ namespace ns struct y_member; struct z_member; - struct unavailable_member; + struct non_member; class point { @@ -141,7 +141,7 @@ main() BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index 15e2124c..d8bd0864 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -26,31 +26,37 @@ namespace ns struct y_member; struct z_member; - template + struct non_member; + + template class point { public: - point() : x(0), y(0) {} - point(X in_x, Y in_y) : x(in_x), y(in_y) {} + point() : x(0), y(0), z(0) {} + point(X in_x, Y in_y, Z in_z) : x(in_x), y(in_y), z(in_z) {} X get_x() const { return x; } Y get_y() const { return y; } + Z get_z() const { return z; } void set_x(X x_) { x = x_; } void set_y(Y y_) { y = y_; } + void set_z(Z z_) { z = z_; } private: X x; Y y; + Z z; }; } BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( - (X)(Y), - (ns::point)(X)(Y), + (X)(Y)(Z), + (ns::point)(X)(Y)(Z), (X, X, obj.get_x(), obj.set_x(val), ns::x_member) (Y, Y, obj.get_y(), obj.set_y(val), ns::y_member) + (obj.get_z(), obj.set_z(val), ns::z_member) ) int @@ -58,7 +64,7 @@ main() { using namespace boost::fusion; - typedef ns::point point; + typedef ns::point point; std::cout << tuple_open('['); std::cout << tuple_close(']'); @@ -66,28 +72,30 @@ main() { BOOST_MPL_ASSERT_NOT((traits::is_view)); - point p(123, 456); + point p(123, 456, 789); std::cout << at_c<0>(p) << std::endl; std::cout << at_c<1>(p) << std::endl; + std::cout << at_c<2>(p) << std::endl; std::cout << p << std::endl; - BOOST_TEST(p == make_vector(123, 456)); + BOOST_TEST(p == make_vector(123, 456, 789)); at_c<0>(p) = 6; at_c<1>(p) = 9; - BOOST_TEST(p == make_vector(6, 9)); + at_c<2>(p) = 12; + BOOST_TEST(p == make_vector(6, 9, 12)); - BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 2); + BOOST_STATIC_ASSERT(boost::fusion::result_of::size::value == 3); BOOST_STATIC_ASSERT(!boost::fusion::result_of::empty::value); BOOST_TEST(front(p) == 6); - BOOST_TEST(back(p) == 9); + BOOST_TEST(back(p) == 12); } { - boost::fusion::vector v1(4, 2); - point v2(5, 3); - boost::fusion::vector v3(5, 4); + boost::fusion::vector v1(4, 2, 2); + point v2(5, 3, 3); + boost::fusion::vector v3(5, 4, 4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); @@ -100,15 +108,15 @@ main() { // conversion from point to vector - point p(5, 3); - boost::fusion::vector v(p); + point p(5, 3, 3); + boost::fusion::vector v(p); v = p; } { // conversion from point to list - point p(5, 3); - boost::fusion::list l(p); + point p(5, 3, 3); + boost::fusion::list l(p); l = p; } @@ -123,15 +131,18 @@ main() // assoc stuff BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); - BOOST_MPL_ASSERT((boost::mpl::not_ >)); + BOOST_MPL_ASSERT((boost::fusion::result_of::has_key)); + BOOST_MPL_ASSERT((boost::mpl::not_ >)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, long>)); - point p(5, 3); + point p(5, 3, 1); BOOST_TEST(at_key(p) == 5); BOOST_TEST(at_key(p) == 3); + BOOST_TEST(at_key(p) == 1); } return boost::report_errors(); From 3a28c3fd81fb1b5f5f4988a9abb1ef369063f224 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Mon, 20 Oct 2014 21:35:01 +0200 Subject: [PATCH 67/85] Updates the doc of ADAPT_ADTs macros --- doc/adapted.qbk | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index 8d6893ba..9fd6c24a 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -742,8 +742,8 @@ namespace qualified name of the class type to be adapted. BOOST_FUSION_ADAPT_ADT( demo::employee, - (std::string const&, std::string const&, obj.get_name(), obj.set_name(val)) - (int, int, obj.get_age(), obj.set_age(val))) + (obj.get_name(), obj.set_name(val)) + (obj.get_age(), obj.set_age(val))) demo::employee e; front(e)="Edward Norton"; @@ -768,8 +768,8 @@ __random_access_sequence__. BOOST_FUSION_ADAPT_TPL_ADT( (template_param0)(template_param1)..., (type_name) (specialization_param0)(specialization_param1)..., - (attribute_type0, attribute_const_type0, get_expr0, set_expr0) - (attribute_type1, attribute_const_type1, get_expr1, set_expr1) + ([attribute_type0, attribute_const_type0,] get_expr0, set_expr0) + ([attribute_type1, attribute_const_type1,] get_expr1, set_expr1) ... ) @@ -792,7 +792,9 @@ of an instance of `type_name`. This expression may access a variable named `obj` of type `type_name&` or `type_name const&` which represents the underlying instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types -that [^get_expr['N]] denotes to. +that [^get_expr['N]] denotes to, when omitted the type is deduced from +[get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for +variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. [^set_expr['N]] is the expression that is invoked to set the ['N]th element of an instance of `type_name`. This expression may access variables named `obj` of type `type_name&`, which represent the corresponding instance of @@ -877,8 +879,8 @@ __random_access_sequence__ and __associative_sequence__. BOOST_FUSION_ADAPT_ASSOC_ADT( type_name, - (attribute_type0, attribute_const_type0, get_expr0, set_expr0, key_type0) - (attribute_type1, attribute_const_type1, get_expr1, set_expr1, key_type1) + ([attribute_type0, attribute_const_type0,] get_expr0, set_expr0, key_type0) + ([attribute_type1, attribute_const_type1,] get_expr1, set_expr1, key_type1) ... ) @@ -895,7 +897,9 @@ of an instance of `type_name`. This expression may access a variable named `obj` of type `type_name&` or `type_name const&` which represents the underlying instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types -that [^get_expr['N]] denotes to. +that [^get_expr['N]] denotes to, when omitted the type is deduced from +[get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for +variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. [^set_expr['N]] is the expression that is invoked to set the ['N]th element of an instance of `type_name`. This expression may access variables named `obj` of type `type_name&`, which represent the corresponding instance of @@ -959,8 +963,8 @@ namespace qualified name of the class type to be adapted. BOOST_FUSION_ADAPT_ASSOC_ADT( demo::employee, - (std::string const&, std::string const&, obj.get_name(), obj.set_name(val), keys::name) - (int, int, obj.get_age(), obj.set_age(val), keys::age)) + (obj.get_name(), obj.set_name(val), keys::name) + (obj.get_age(), obj.set_age(val), keys::age)) demo::employee e; at_key(e)="Edward Norton"; @@ -985,8 +989,8 @@ __random_access_sequence__ and __associative_sequence__. BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( (template_param0)(template_param1)..., (type_name) (specialization_param0)(specialization_param1)..., - (attribute_type0, attribute_const_type0, get_expr0, set_expr0, key_type0) - (attribute_type1, attribute_const_type1, get_expr1, set_expr1, key_type1) + ([attribute_type0, attribute_const_type0,] get_expr0, set_expr0, key_type0) + ([attribute_type1, attribute_const_type1,] get_expr1, set_expr1, key_type1) ... ) @@ -1001,7 +1005,7 @@ The sequence `(specialization_param0)(specialization_param1)...` declares the template parameters of the actual specialization of `type_name` that is adapted as a fusion sequence. The sequence of -[^(attribute_type['N], attribute_const_type['N], get_expr['N], set_expr['N], key_type['N])] +[^([attribute_type['N], attribute_const_type['N],] get_expr['N], set_expr['N], key_type['N])] 5-tuples declares the types, const types, get-expressions, set-expressions and key types of the elements that are part of the adapted fusion sequence. [^get_expr['N]] is the expression that is invoked to get the ['N]th element @@ -1009,7 +1013,9 @@ of an instance of `type_name`. This expression may access a variable named `obj` of type `type_name&` or `type_name const&` which represents the underlying instance of `type_name`. [^attribute_type['N]] and [^attribute_const_type['N]] may specify the types -that [^get_expr['N]] denotes to. +that [^get_expr['N]] denotes to, when omitted the type is deduced from +[get_expr['N]] return type via BOOST_TYPEOF. On compiler missing support for +variadic macros BOOST_FUSION_ADAPT_AUTO can be used to avoid repeating the type. [^set_expr['N]] is the expression that is invoked to set the ['N]th element of an instance of `type_name`. This expression may access variables named `obj` of type `type_name&`, which represent the corresponding instance of From 020b22f9b9fd16762cd568aaaf8313d9c9d741fe Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Mon, 20 Oct 2014 22:32:28 +0200 Subject: [PATCH 68/85] Fix test for compiler not supporting BOOST_PP_VARIADIC. --- test/sequence/adapt_assoc_tpl_adt.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/sequence/adapt_assoc_tpl_adt.cpp b/test/sequence/adapt_assoc_tpl_adt.cpp index d8bd0864..8aa600ff 100644 --- a/test/sequence/adapt_assoc_tpl_adt.cpp +++ b/test/sequence/adapt_assoc_tpl_adt.cpp @@ -51,6 +51,7 @@ namespace ns }; } +#if BOOST_PP_VARIADICS BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( (X)(Y)(Z), (ns::point)(X)(Y)(Z), @@ -58,6 +59,17 @@ BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( (Y, Y, obj.get_y(), obj.set_y(val), ns::y_member) (obj.get_z(), obj.set_z(val), ns::z_member) ) + +#else // BOOST_PP_VARIADICS +BOOST_FUSION_ADAPT_ASSOC_TPL_ADT( + (X)(Y)(Z), + (ns::point)(X)(Y)(Z), + (X, X, obj.get_x(), obj.set_x(val), ns::x_member) + (Y, Y, obj.get_y(), obj.set_y(val), ns::y_member) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val), ns::z_member) +) + +#endif int main() From e50f5852e4cb7816de90f5e1dd15966a9cb659c5 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 22 Oct 2014 22:06:31 +0200 Subject: [PATCH 69/85] Changes the test cases, as the behaviour about const-qualifier for attribute_type and attribute_const_type when type is deduced can be different than when the type is provided. Indeed when specifying attribute_type and attribute_const_type manually it's possible to provide a type which isn't const qualified as attribute_const_type. When deducing the types from the get_expr, a const and a non const qualified type is taken respectively for attribute_type and attribute_const_type. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 10 +++---- test/sequence/adapt_adt.cpp | 29 +++++++++++++++++-- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 80a62b3e..c1c78962 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -84,7 +84,7 @@ BOOST_PP_IF(DEDUCE_TYPE, \ BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF, \ BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE \ - )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) /* XXX: Check PROXY PREFIX */\ + )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ \ template \ BOOST_FUSION_GPU_ENABLED \ @@ -98,7 +98,7 @@ } \ \ BOOST_FUSION_GPU_ENABLED \ - static type /* TODO: Check Type here */ \ + static type \ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ { \ @@ -107,7 +107,7 @@ } \ \ BOOST_FUSION_GPU_ENABLED \ - static const_type /* TODO: check Const Type here */ \ + static const_type \ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ { \ @@ -128,7 +128,7 @@ typedef typename access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ - >::const_type type; /* TODO: check const Type here */ \ + >::const_type type; \ \ BOOST_FUSION_GPU_ENABLED \ explicit \ @@ -167,7 +167,7 @@ typedef typename access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ - >::type type; /* TODO: check Type here */ \ + >::type type; \ \ BOOST_FUSION_GPU_ENABLED \ explicit \ diff --git a/test/sequence/adapt_adt.cpp b/test/sequence/adapt_adt.cpp index 3a08000f..265cfca5 100644 --- a/test/sequence/adapt_adt.cpp +++ b/test/sequence/adapt_adt.cpp @@ -102,9 +102,9 @@ namespace ns #if BOOST_PP_VARIADICS BOOST_FUSION_ADAPT_ADT( ns::point, - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_x(), obj.set_x(val)) - (obj.get_y(), obj.set_y(val)) - (int, int, obj.get_z(), obj.set_z(val)) + (int, int, obj.get_x(), obj.set_x(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_y(), obj.set_y(val)) + (obj.get_z(), obj.set_z(val)) ) # if !BOOST_WORKAROUND(__GNUC__,<4) @@ -255,6 +255,7 @@ main() #endif { + // Check types provided in case it's provided BOOST_MPL_ASSERT(( boost::is_same< boost::fusion::result_of::front::type, @@ -275,6 +276,28 @@ main() boost::fusion::result_of::front::type::type, int >)); + + // Check types provided in case it's deduced + BOOST_MPL_ASSERT(( + boost::is_same< + boost::fusion::result_of::back::type, + boost::fusion::extension::adt_attribute_proxy + >)); + BOOST_MPL_ASSERT(( + boost::is_same< + boost::fusion::result_of::back::type::type, + int + >)); + BOOST_MPL_ASSERT(( + boost::is_same< + boost::fusion::result_of::back::type, + boost::fusion::extension::adt_attribute_proxy + >)); + BOOST_MPL_ASSERT(( + boost::is_same< + boost::fusion::result_of::back::type::type, + const int + >)); } return boost::report_errors(); From 18fa262a4edcfbee1455070af33a1e773ec1c38d Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 18 Nov 2014 22:50:07 +0100 Subject: [PATCH 70/85] BUGFIX: Use of non-static member in typedef to retrieve the type. clang doesn't allow this even in unevaluated context like decltype. --- include/boost/fusion/adapted/adt/detail/adapt_base.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index c1c78962..2b47e70e 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -48,6 +48,7 @@ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ \ struct deduced_attr_type { \ + static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ typedef BOOST_TYPEOF( \ BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ From b5018586aad1475652702a41d4f317f4494bdda9 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 18 Nov 2014 23:38:47 +0100 Subject: [PATCH 71/85] Breaking change of BOOST_FUSION_ADAPT_ADT_NAMED and BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED API to be coherent with the expressions of BOOST_FUSION_ADAPT_ADT thanks to correct usage of BOOST_FUSION_PROXY_PREFIX. --- .../boost/fusion/adapted/adt/adapt_adt.hpp | 2 ++ .../fusion/adapted/adt/adapt_assoc_adt.hpp | 2 ++ .../fusion/adapted/adt/detail/adapt_base.hpp | 19 ++++++++++--------- test/sequence/adapt_adt_named.cpp | 12 ++++++------ test/sequence/adapt_assoc_adt_named.cpp | 4 ++-- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/include/boost/fusion/adapted/adt/adapt_adt.hpp b/include/boost/fusion/adapted/adt/adapt_adt.hpp index 37781765..7ff6f4ee 100644 --- a/include/boost/fusion/adapted/adt/adapt_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_adt.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,7 @@ TEMPLATE_PARAMS_SEQ, \ NAME_SEQ, \ I, \ + BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_PP_IF( \ diff --git a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp index 14eec414..49a8805d 100644 --- a/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp +++ b/include/boost/fusion/adapted/adt/adapt_assoc_adt.hpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -45,6 +46,7 @@ TEMPLATE_PARAMS_SEQ, \ NAME_SEQ, \ I, \ + BOOST_PP_IF(IS_VIEW, BOOST_FUSION_PROXY_PREFIX, BOOST_PP_EMPTY), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR(ATTRIBUTE), \ BOOST_FUSION_ADAPT_ADT_WRAPPEDATTR_SIZE(ATTRIBUTE), \ BOOST_PP_IF( \ diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 2b47e70e..9768ae3a 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -45,14 +45,14 @@ BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE) #define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ typedef BOOST_TYPEOF( \ - BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ - ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ + PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ + ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ }; \ \ typedef typename boost::remove_const< \ @@ -64,14 +64,15 @@ >::type const_type; #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ \ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) const_type; #define BOOST_FUSION_ADAPT_ADT_C_BASE( \ - TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX, \ + ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE) \ \ template< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ @@ -85,7 +86,7 @@ BOOST_PP_IF(DEDUCE_TYPE, \ BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF, \ BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE \ - )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE) \ + )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ \ template \ BOOST_FUSION_GPU_ENABLED \ @@ -94,7 +95,7 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj, \ Val const& val) \ { \ - BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \ + PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_SETEXPR(ATTRIBUTE, \ ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ } \ \ @@ -103,7 +104,7 @@ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ { \ - return BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ + return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ } \ \ @@ -112,7 +113,7 @@ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ { \ - return BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ + return PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR(ATTRIBUTE, \ ATTRIBUTE_TUPEL_SIZE, DEDUCE_TYPE); \ } \ }; \ diff --git a/test/sequence/adapt_adt_named.cpp b/test/sequence/adapt_adt_named.cpp index cdb4806f..8924ce41 100644 --- a/test/sequence/adapt_adt_named.cpp +++ b/test/sequence/adapt_adt_named.cpp @@ -60,9 +60,9 @@ namespace ns // this creates a fusion view: boost::fusion::adapted::point BOOST_FUSION_ADAPT_ADT_NAMED( ns::point, point, - (int, int, obj.obj.get_x(), obj.obj.set_x(val)) - (int, int, obj.obj.get_y(), obj.obj.set_y(val)) - (obj.obj.get_z(), obj.obj.set_z(val)) + (int, int, obj.get_x(), obj.set_x(val)) + (int, int, obj.get_y(), obj.set_y(val)) + (obj.get_z(), obj.set_z(val)) ) #else // BOOST_PP_VARIADICS @@ -70,9 +70,9 @@ BOOST_FUSION_ADAPT_ADT_NAMED( // this creates a fusion view: boost::fusion::adapted::point BOOST_FUSION_ADAPT_ADT_NAMED( ns::point, point, - (int, int, obj.obj.get_x(), obj.obj.set_x(val)) - (int, int, obj.obj.get_y(), obj.obj.set_y(val)) - (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.obj.get_z(), obj.obj.set_z(val)) + (int, int, obj.get_x(), obj.set_x(val)) + (int, int, obj.get_y(), obj.set_y(val)) + (BOOST_FUSION_ADAPT_AUTO, BOOST_FUSION_ADAPT_AUTO, obj.get_z(), obj.set_z(val)) ) #endif // BOOST_PP_VARIADICS diff --git a/test/sequence/adapt_assoc_adt_named.cpp b/test/sequence/adapt_assoc_adt_named.cpp index d68d9904..8ef9aa27 100644 --- a/test/sequence/adapt_assoc_adt_named.cpp +++ b/test/sequence/adapt_assoc_adt_named.cpp @@ -48,8 +48,8 @@ namespace ns BOOST_FUSION_ADAPT_ASSOC_ADT_NAMED( ns::point, point, - (int, int, obj.obj.get_x(), obj.obj.set_x(val), ns::x_member) - (int, int, obj.obj.get_y(), obj.obj.set_y(val), ns::y_member) + (int, int, obj.get_x(), obj.set_x(val), ns::x_member) + (int, int, obj.get_y(), obj.set_y(val), ns::y_member) ) int From bc07cac46c9b136450c906d5469c3ac6df1cfb58 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Tue, 18 Nov 2014 23:39:53 +0100 Subject: [PATCH 72/85] Fix use of non-static "obj" in unevaluated expression context of decltype. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 1 - .../adapted/struct/detail/adapt_base.hpp | 25 ++++++++++++------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 9768ae3a..b9126c94 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -49,7 +49,6 @@ \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ - const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ typedef BOOST_TYPEOF( \ PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index dc6ec3ce..3d755f72 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -64,13 +64,21 @@ #define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ - BOOST_TYPEOF( \ - BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)::PREFIX() \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) + \ + struct deduced_attr_type { \ + static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ + typedef BOOST_TYPEOF( \ + PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE)) \ + type; \ + }; \ + \ + typedef typename deduced_attr_type::type attribute_type; #define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, unused) \ - BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) + typedef \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) attribute_type; + #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS # define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ @@ -137,11 +145,10 @@ , I \ > \ { \ - typedef \ - BOOST_PP_IF(DEDUCE_TYPE, \ - BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE \ - )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ - attribute_type; \ + BOOST_PP_IF(DEDUCE_TYPE, \ + BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE \ + )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ + \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ \ From f872d1326a3bb63da5f4b505fb8403c6610c8f10 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sun, 11 Jan 2015 01:15:52 +0900 Subject: [PATCH 73/85] The ctor should check which is seqence or not. --- include/boost/fusion/container/list/cons.hpp | 15 ++++++++++++--- include/boost/fusion/container/list/list.hpp | 11 +++++++---- include/boost/fusion/container/set/set.hpp | 5 ++++- .../fusion/container/vector/detail/vector_n.hpp | 2 ++ include/boost/fusion/container/vector/vector.hpp | 5 ++++- .../boost/fusion/container/vector/vector10.hpp | 1 + .../boost/fusion/container/vector/vector20.hpp | 1 + .../boost/fusion/container/vector/vector30.hpp | 1 + .../boost/fusion/container/vector/vector40.hpp | 1 + .../boost/fusion/container/vector/vector50.hpp | 1 + 10 files changed, 34 insertions(+), 9 deletions(-) diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp index 2654e8fb..575e4d9e 100644 --- a/include/boost/fusion/container/list/cons.hpp +++ b/include/boost/fusion/container/list/cons.hpp @@ -25,8 +25,11 @@ #include #include #include +#include #include #include +#include +#include namespace boost { namespace fusion { @@ -73,8 +76,10 @@ namespace boost { namespace fusion BOOST_FUSION_GPU_ENABLED cons( Sequence const& seq - , typename boost::disable_if< - is_convertible // use copy to car instead + , typename boost::enable_if< + mpl::and_< + traits::is_sequence + , mpl::not_ > > // use copy to car instead >::type* /*dummy*/ = 0 ) : car(*fusion::begin(seq)) @@ -105,7 +110,11 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - typename boost::disable_if, cons&>::type + typename boost::enable_if< + mpl::and_< + traits::is_sequence + , mpl::not_ > > + , cons&>::type operator=(Sequence const& seq) { typedef typename result_of::begin::type Iterator; diff --git a/include/boost/fusion/container/list/list.hpp b/include/boost/fusion/container/list/list.hpp index 3b638315..7f71856d 100644 --- a/include/boost/fusion/container/list/list.hpp +++ b/include/boost/fusion/container/list/list.hpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) #include @@ -59,7 +61,8 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - list(Sequence const& rhs) + list(Sequence const& rhs + , typename boost::enable_if >::type* = 0) : inherited_type(rhs) {} // Expand a couple of forwarding constructors for arguments @@ -80,10 +83,10 @@ namespace boost { namespace fusion return *this; } - template + template BOOST_FUSION_GPU_ENABLED - list& - operator=(T const& rhs) + typename boost::enable_if, list&>::type + operator=(Sequence const& rhs) { inherited_type::operator=(rhs); return *this; diff --git a/include/boost/fusion/container/set/set.hpp b/include/boost/fusion/container/set/set.hpp index e1d019a7..3d7bdfce 100644 --- a/include/boost/fusion/container/set/set.hpp +++ b/include/boost/fusion/container/set/set.hpp @@ -8,6 +8,7 @@ #define FUSION_SET_09162005_1104 #include +#include #include #include #include @@ -22,6 +23,7 @@ #include #include #include +#include #if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) #include @@ -69,7 +71,8 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - set(Sequence const& rhs) + set(Sequence const& rhs + , typename boost::enable_if >::type* = 0) : data(rhs) {} #include diff --git a/include/boost/fusion/container/vector/detail/vector_n.hpp b/include/boost/fusion/container/vector/detail/vector_n.hpp index 2196e7f2..b7a910aa 100644 --- a/include/boost/fusion/container/vector/detail/vector_n.hpp +++ b/include/boost/fusion/container/vector/detail/vector_n.hpp @@ -208,6 +208,7 @@ FUSION_HASH endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( Sequence const& seq + , typename boost::enable_if >::type* = 0 #if (N == 1) , typename boost::disable_if >::type* /*dummy*/ = 0 #endif @@ -218,6 +219,7 @@ FUSION_HASH endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( Sequence& seq + , typename boost::enable_if >::type* = 0 #if (N == 1) , typename boost::disable_if >::type* /*dummy*/ = 0 #endif diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 2dd584b5..6728fa40 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -20,6 +21,7 @@ #include #include #include +#include #define FUSION_HASH # @@ -115,7 +117,8 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - vector(Sequence const& rhs) + vector(Sequence const& rhs, + typename boost::enable_if >::type* = 0) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} // Expand a couple of forwarding constructors for arguments diff --git a/include/boost/fusion/container/vector/vector10.hpp b/include/boost/fusion/container/vector/vector10.hpp index 4f9b18f5..2e24f028 100644 --- a/include/boost/fusion/container/vector/vector10.hpp +++ b/include/boost/fusion/container/vector/vector10.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector20.hpp b/include/boost/fusion/container/vector/vector20.hpp index 11df2420..61978dcb 100644 --- a/include/boost/fusion/container/vector/vector20.hpp +++ b/include/boost/fusion/container/vector/vector20.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector30.hpp b/include/boost/fusion/container/vector/vector30.hpp index de379a06..f034abd5 100644 --- a/include/boost/fusion/container/vector/vector30.hpp +++ b/include/boost/fusion/container/vector/vector30.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector40.hpp b/include/boost/fusion/container/vector/vector40.hpp index 2c6fd854..5a7bb44c 100644 --- a/include/boost/fusion/container/vector/vector40.hpp +++ b/include/boost/fusion/container/vector/vector40.hpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/fusion/container/vector/vector50.hpp b/include/boost/fusion/container/vector/vector50.hpp index d2099665..2448d51e 100644 --- a/include/boost/fusion/container/vector/vector50.hpp +++ b/include/boost/fusion/container/vector/vector50.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include From d7c918e36f2c2a952178e4e9a39f674f5643f820 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sun, 11 Jan 2015 02:15:45 +0900 Subject: [PATCH 74/85] Fix ODR-used violations. --- include/boost/fusion/algorithm/iteration/fold_fwd.hpp | 8 ++++---- .../boost/fusion/algorithm/iteration/iter_fold_fwd.hpp | 8 ++++---- .../boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp | 8 ++++---- .../fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp | 8 ++++---- include/boost/fusion/algorithm/query/find_if_fwd.hpp | 4 ++-- include/boost/fusion/algorithm/transformation/erase.hpp | 4 ++-- include/boost/fusion/iterator/deref.hpp | 4 ++-- include/boost/fusion/iterator/deref_data.hpp | 2 +- include/boost/fusion/iterator/next.hpp | 2 +- include/boost/fusion/iterator/prior.hpp | 2 +- include/boost/fusion/support/segmented_fold_until.hpp | 4 ++-- .../iterator_range/detail/segmented_iterator_range.hpp | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/include/boost/fusion/algorithm/iteration/fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/fold_fwd.hpp index 5bf9e816..f8328e80 100644 --- a/include/boost/fusion/algorithm/iteration/fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/fold_fwd.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::fold< + inline typename result_of::fold< Seq , State const , F @@ -27,7 +27,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::fold< + inline typename result_of::fold< Seq const , State const , F @@ -36,7 +36,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::fold< + inline typename result_of::fold< Seq , State const , F @@ -45,7 +45,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::fold< + inline typename result_of::fold< Seq const , State const , F diff --git a/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp index 84aabfde..6c595cf1 100644 --- a/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/iter_fold_fwd.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::iter_fold< + inline typename result_of::iter_fold< Seq , State const , F @@ -27,7 +27,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::iter_fold< + inline typename result_of::iter_fold< Seq const , State const , F @@ -36,7 +36,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::iter_fold< + inline typename result_of::iter_fold< Seq , State const , F @@ -45,7 +45,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::iter_fold< + inline typename result_of::iter_fold< Seq const , State const , F diff --git a/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp index 82fad70a..42c8ac21 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_fold_fwd.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_fold< + inline typename result_of::reverse_fold< Seq , State const , F @@ -27,7 +27,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_fold< + inline typename result_of::reverse_fold< Seq const , State const , F @@ -36,7 +36,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_fold< + inline typename result_of::reverse_fold< Seq , State const , F @@ -45,7 +45,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_fold< + inline typename result_of::reverse_fold< Seq const , State const , F diff --git a/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp b/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp index 9f002419..21d99dee 100644 --- a/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/reverse_iter_fold_fwd.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_iter_fold< + inline typename result_of::reverse_iter_fold< Seq , State const , F @@ -27,7 +27,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_iter_fold< + inline typename result_of::reverse_iter_fold< Seq const , State const , F @@ -36,7 +36,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_iter_fold< + inline typename result_of::reverse_iter_fold< Seq , State const , F @@ -45,7 +45,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::reverse_iter_fold< + inline typename result_of::reverse_iter_fold< Seq const , State const , F diff --git a/include/boost/fusion/algorithm/query/find_if_fwd.hpp b/include/boost/fusion/algorithm/query/find_if_fwd.hpp index 419a68c4..cbe9e5e9 100644 --- a/include/boost/fusion/algorithm/query/find_if_fwd.hpp +++ b/include/boost/fusion/algorithm/query/find_if_fwd.hpp @@ -22,7 +22,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - typename + inline typename lazy_disable_if< is_const , result_of::find_if @@ -31,7 +31,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - typename result_of::find_if::type const + inline typename result_of::find_if::type const find_if(Sequence const& seq); }} diff --git a/include/boost/fusion/algorithm/transformation/erase.hpp b/include/boost/fusion/algorithm/transformation/erase.hpp index 6ffdb4de..2d220947 100644 --- a/include/boost/fusion/algorithm/transformation/erase.hpp +++ b/include/boost/fusion/algorithm/transformation/erase.hpp @@ -100,7 +100,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - typename + inline typename lazy_enable_if< traits::is_sequence , typename result_of::erase @@ -123,7 +123,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - typename result_of::erase::type + inline typename result_of::erase::type erase(Sequence const& seq, First const& first, Last const& last) { typedef result_of::erase result_of; diff --git a/include/boost/fusion/iterator/deref.hpp b/include/boost/fusion/iterator/deref.hpp index b6fee6a5..c31962cb 100644 --- a/include/boost/fusion/iterator/deref.hpp +++ b/include/boost/fusion/iterator/deref.hpp @@ -56,7 +56,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::deref::type + inline typename result_of::deref::type deref(Iterator const& i) { typedef result_of::deref deref_meta; @@ -65,7 +65,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::deref::type + inline typename result_of::deref::type operator*(iterator_base const& i) { return fusion::deref(i.cast()); diff --git a/include/boost/fusion/iterator/deref_data.hpp b/include/boost/fusion/iterator/deref_data.hpp index 20d82ebf..65a43324 100644 --- a/include/boost/fusion/iterator/deref_data.hpp +++ b/include/boost/fusion/iterator/deref_data.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::deref_data::type + inline typename result_of::deref_data::type deref_data(It const& it) { return result_of::deref_data::call(it); diff --git a/include/boost/fusion/iterator/next.hpp b/include/boost/fusion/iterator/next.hpp index 20d3df94..d6ca3d66 100644 --- a/include/boost/fusion/iterator/next.hpp +++ b/include/boost/fusion/iterator/next.hpp @@ -55,7 +55,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::next::type const + inline typename result_of::next::type const next(Iterator const& i) { return result_of::next::call(i); diff --git a/include/boost/fusion/iterator/prior.hpp b/include/boost/fusion/iterator/prior.hpp index a3541280..80e891c7 100644 --- a/include/boost/fusion/iterator/prior.hpp +++ b/include/boost/fusion/iterator/prior.hpp @@ -55,7 +55,7 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - typename result_of::prior::type const + inline typename result_of::prior::type const prior(Iterator const& i) { return result_of::prior::call(i); diff --git a/include/boost/fusion/support/segmented_fold_until.hpp b/include/boost/fusion/support/segmented_fold_until.hpp index 8d3ea682..cf01fea4 100644 --- a/include/boost/fusion/support/segmented_fold_until.hpp +++ b/include/boost/fusion/support/segmented_fold_until.hpp @@ -46,7 +46,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - typename + inline typename lazy_disable_if< is_const , result_of::segmented_fold_until @@ -62,7 +62,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - typename result_of::segmented_fold_until::type + inline typename result_of::segmented_fold_until::type segmented_fold_until(Sequence const& seq, State const& state, Fun const& fun) { typedef diff --git a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp index 7dc4506c..9a744a59 100644 --- a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp +++ b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp @@ -49,7 +49,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - typename + inline typename lazy_enable_if< traits::is_sequence , result_of::push_back @@ -58,7 +58,7 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - typename + inline typename lazy_enable_if< traits::is_sequence , result_of::push_front From 98247fb97fac82c0af8d27bc03f02bff2dc299bd Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Wed, 21 Jan 2015 00:28:13 +0100 Subject: [PATCH 75/85] =?UTF-8?q?BUGFIX:=C2=A0MSVC=20doesn't=20accept=20ty?= =?UTF-8?q?pename=20to=20specify=20a=20dependent=20scope=20within=20templa?= =?UTF-8?q?te=20specialization=20in=20C++03=20as=20standard=20specify=20it?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also works on GCC 4.6, 4.8.2 and 4.9 in C++11 and C++03, I needlessly added this during some debugging where the compiler was telling me to do so. I shouldn't have followed it's advice, as this breaks compatibility with other compilers. --- .../boost/fusion/adapted/adt/detail/adapt_base.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index b9126c94..0c1cebd0 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -54,12 +54,12 @@ ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ }; \ \ - typedef typename boost::remove_const< \ - typename deduced_attr_type::type \ + typedef boost::remove_const< \ + deduced_attr_type::type \ >::type type; \ \ - typedef typename boost::add_const< \ - typename deduced_attr_type::type \ + typedef boost::add_const< \ + deduced_attr_type::type \ >::type const_type; #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ @@ -126,7 +126,7 @@ , true \ > \ { \ - typedef typename access::adt_attribute_access< \ + typedef access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ >::const_type type; \ @@ -165,7 +165,7 @@ , false \ > \ { \ - typedef typename access::adt_attribute_access< \ + typedef access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ >::type type; \ @@ -215,7 +215,7 @@ , I \ > \ { \ - typedef typename \ + typedef \ adt_attribute_proxy< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ From 70d5b40a7cfc08089f7ad862af073332cd6ab49e Mon Sep 17 00:00:00 2001 From: Damien Buhl alias daminetreg Date: Sun, 25 Jan 2015 16:10:34 +0100 Subject: [PATCH 76/85] BUGFIX: Expands typename for attribute_type only in case it is really a dependent scope. --- .../fusion/adapted/struct/detail/adapt_base.hpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 3d755f72..6120a3b1 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -63,7 +63,7 @@ #define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, IS_TPL) \ \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ @@ -72,10 +72,11 @@ type; \ }; \ \ - typedef typename deduced_attr_type::type attribute_type; + typedef BOOST_PP_IF(IS_TPL, typename, ) \ + deduced_attr_type::type attribute_type; #define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, unused) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, IS_TPL) \ typedef \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) attribute_type; @@ -146,8 +147,12 @@ > \ { \ BOOST_PP_IF(DEDUCE_TYPE, \ - BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE \ - )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ + BOOST_FUSION_ATTRIBUTE_TYPEOF, BOOST_FUSION_ATTRIBUTE_GIVENTYPE)( \ + NAME_SEQ, \ + ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, \ + PREFIX, \ + BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ)) \ \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ From 588896de455d78d06f720e8b131fc6c3970b927f Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 25 Jan 2015 16:14:45 +0100 Subject: [PATCH 77/85] =?UTF-8?q?Revert=20"BUGFIX:=C2=A0MSVC=20doesn't=20a?= =?UTF-8?q?ccept=20typename=20to=20specify=20a=20dependent=20scope=20withi?= =?UTF-8?q?n"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 98247fb97fac82c0af8d27bc03f02bff2dc299bd. --- .../boost/fusion/adapted/adt/detail/adapt_base.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 0c1cebd0..b9126c94 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -54,12 +54,12 @@ ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ }; \ \ - typedef boost::remove_const< \ - deduced_attr_type::type \ + typedef typename boost::remove_const< \ + typename deduced_attr_type::type \ >::type type; \ \ - typedef boost::add_const< \ - deduced_attr_type::type \ + typedef typename boost::add_const< \ + typename deduced_attr_type::type \ >::type const_type; #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ @@ -126,7 +126,7 @@ , true \ > \ { \ - typedef access::adt_attribute_access< \ + typedef typename access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ >::const_type type; \ @@ -165,7 +165,7 @@ , false \ > \ { \ - typedef access::adt_attribute_access< \ + typedef typename access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ >::type type; \ @@ -215,7 +215,7 @@ , I \ > \ { \ - typedef \ + typedef typename \ adt_attribute_proxy< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ From 382c1e56458d139d8d39b64887cabc98a092cf33 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 25 Jan 2015 21:48:49 +0100 Subject: [PATCH 78/85] BUGFIX: Expands typename for attribute_type only in case it is really a dependent scope. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index b9126c94..ff514c7f 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -45,7 +45,7 @@ BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE) #define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, IS_TPL) \ \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ @@ -54,16 +54,16 @@ ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ }; \ \ - typedef typename boost::remove_const< \ - typename deduced_attr_type::type \ + typedef BOOST_PP_IF(IS_TPL, typename, ) boost::remove_const< \ + BOOST_PP_IF(IS_TPL, typename, ) deduced_attr_type::type \ >::type type; \ \ - typedef typename boost::add_const< \ - typename deduced_attr_type::type \ + typedef BOOST_PP_IF(IS_TPL, typename, ) boost::add_const< \ + BOOST_PP_IF(IS_TPL, typename, ) deduced_attr_type::type \ >::type const_type; #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, IS_TPL) \ \ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) const_type; @@ -84,8 +84,12 @@ \ BOOST_PP_IF(DEDUCE_TYPE, \ BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF, \ - BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE \ - )(NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX) \ + BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE)( \ + NAME_SEQ, \ + ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, \ + PREFIX, \ + BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ)) \ \ template \ BOOST_FUSION_GPU_ENABLED \ @@ -126,7 +130,9 @@ , true \ > \ { \ - typedef typename access::adt_attribute_access< \ + typedef \ + BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ + access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ >::const_type type; \ @@ -165,7 +171,9 @@ , false \ > \ { \ - typedef typename access::adt_attribute_access< \ + typedef \ + BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ + access::adt_attribute_access< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ >::type type; \ @@ -215,7 +223,7 @@ , I \ > \ { \ - typedef typename \ + typedef BOOST_PP_IF(BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), typename, ) \ adt_attribute_proxy< \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ , I \ From de43345b346af9fa6c42707fbdea00d1e3a5ed4d Mon Sep 17 00:00:00 2001 From: Damien Buhl alias daminetreg Date: Sun, 25 Jan 2015 23:05:42 +0100 Subject: [PATCH 79/85] BUGFIX: Forwarding template parameters for MSVC to deduced_attr_type context thanks to BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index ff514c7f..49751d0b 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -44,26 +44,37 @@ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE) +#define BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ) \ + BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) + #define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, IS_TPL) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + \ + BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ + TEMPLATE_PARAMS_SEQ) \ \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ - typedef BOOST_TYPEOF( \ + typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + BOOST_TYPEOF( \ PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ }; \ \ - typedef BOOST_PP_IF(IS_TPL, typename, ) boost::remove_const< \ - BOOST_PP_IF(IS_TPL, typename, ) deduced_attr_type::type \ - >::type type; \ + typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + boost::remove_const< \ + BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + deduced_attr_type::type \ + >::type type; \ \ - typedef BOOST_PP_IF(IS_TPL, typename, ) boost::add_const< \ - BOOST_PP_IF(IS_TPL, typename, ) deduced_attr_type::type \ + typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + boost::add_const< \ + BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + deduced_attr_type::type \ >::type const_type; #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, IS_TPL) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) const_type; @@ -89,7 +100,7 @@ ATTRIBUTE, \ ATTRIBUTE_TUPEL_SIZE, \ PREFIX, \ - BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ)) \ + TEMPLATE_PARAMS_SEQ) \ \ template \ BOOST_FUSION_GPU_ENABLED \ From fc1a60e8e660e7dda83acfed10b4f9b9865f0fb5 Mon Sep 17 00:00:00 2001 From: Damien Buhl alias daminetreg Date: Fri, 30 Jan 2015 18:17:36 +0100 Subject: [PATCH 80/85] Adding typename in front of BOOST_TYPEOF is only needed in MSVC when we check the type of a template. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 27 +++++++++++++--- .../adapted/struct/detail/adapt_base.hpp | 32 ++++++++++++++++--- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 49751d0b..4c277d63 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -47,8 +47,9 @@ #define BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ) \ BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) -#define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ +#ifdef BOOST_MSVC +# define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ @@ -56,10 +57,26 @@ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ - BOOST_TYPEOF( \ - PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ + BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ - }; \ + }; + +#else +# define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \ + ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + struct deduced_attr_type { \ + static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ + typedef BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ + ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ + }; + +#endif + +#define BOOST_FUSION_ADT_ATTRIBUTE_TYPEOF( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + \ + BOOST_FUSION_DEDUCED_ATTR_TYPE( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ boost::remove_const< \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 6120a3b1..856de1f0 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -61,9 +61,31 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \ BOOST_PP_TUPLE_EAT(1))(SEQ) +#define BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ) \ + BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) -#define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, IS_TPL) \ + +#ifdef BOOST_MSVC +# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ + \ + BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ + TEMPLATE_PARAMS_SEQ) \ + \ + struct deduced_attr_type { \ + static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ + typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + BOOST_TYPEOF( PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ + 0, ATTRIBUTE)) \ + type; \ + }; \ + \ + typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + deduced_attr_type::type attribute_type; + +#else +# define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ @@ -72,9 +94,11 @@ type; \ }; \ \ - typedef BOOST_PP_IF(IS_TPL, typename, ) \ + typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ deduced_attr_type::type attribute_type; +#endif + #define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, IS_TPL) \ typedef \ @@ -152,7 +176,7 @@ ATTRIBUTE, \ ATTRIBUTE_TUPEL_SIZE, \ PREFIX, \ - BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ)) \ + TEMPLATE_PARAMS_SEQ) \ \ BOOST_FUSION_ADAPT_STRUCT_MSVC_REDEFINE_TEMPLATE_PARAMS( \ TEMPLATE_PARAMS_SEQ) \ From c6c9d872d37f2934605b96f1bed8581a00baceb0 Mon Sep 17 00:00:00 2001 From: "Damien Buhl (alias daminetreg)" Date: Sun, 1 Feb 2015 17:20:31 +0100 Subject: [PATCH 81/85] Factored out the IS_TPL macro. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 25 ++++++++++--------- .../adapted/struct/detail/adapt_base.hpp | 16 ++++++------ .../adapted/struct/detail/adapt_is_tpl.hpp | 14 +++++++++++ 3 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 4c277d63..79fd00d8 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -44,9 +45,6 @@ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ BOOST_PP_IF(DEDUCE_TYPE, 1, 3), ATTRIBUTE) -#define BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ) \ - BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) - #ifdef BOOST_MSVC # define BOOST_FUSION_DEDUCED_ATTR_TYPE(NAME_SEQ, ATTRIBUTE, \ ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ @@ -56,9 +54,10 @@ \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ - typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ - BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ - ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ + typedef \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ + BOOST_TYPEOF( PREFIX() BOOST_FUSION_ADAPT_ADT_ATTRIBUTE_GETEXPR( \ + ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, 1)) type; \ }; #else @@ -78,16 +77,18 @@ BOOST_FUSION_DEDUCED_ATTR_TYPE( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ \ - typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + typedef \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ boost::remove_const< \ - BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ - deduced_attr_type::type \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ + deduced_attr_type::type \ >::type type; \ \ - typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + typedef \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ boost::add_const< \ - BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ - deduced_attr_type::type \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ),typename,) \ + deduced_attr_type::type \ >::type const_type; #define BOOST_FUSION_ADT_ATTRIBUTE_GIVENTYPE( \ diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index 856de1f0..7bb90e2e 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -61,10 +62,6 @@ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \ BOOST_PP_TUPLE_EAT(1))(SEQ) -#define BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ) \ - BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) - - #ifdef BOOST_MSVC # define BOOST_FUSION_ATTRIBUTE_TYPEOF( \ NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ @@ -74,13 +71,15 @@ \ struct deduced_attr_type { \ static const BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ - typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + typedef \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ BOOST_TYPEOF( PREFIX() obj.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, \ 0, ATTRIBUTE)) \ type; \ }; \ \ - typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + typedef \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ deduced_attr_type::type attribute_type; #else @@ -94,13 +93,14 @@ type; \ }; \ \ - typedef BOOST_PP_IF(BOOST_FUSION_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ + typedef \ + BOOST_PP_IF(BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ), typename, ) \ deduced_attr_type::type attribute_type; #endif #define BOOST_FUSION_ATTRIBUTE_GIVENTYPE( \ - NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, IS_TPL) \ + NAME_SEQ, ATTRIBUTE, ATTRIBUTE_TUPEL_SIZE, PREFIX, TEMPLATE_PARAMS_SEQ) \ typedef \ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) attribute_type; diff --git a/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp b/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp new file mode 100644 index 00000000..2b54a2c0 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/adapt_is_tpl.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2013-2014 Damien Buhl + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_IS_TPL_HPP + +#define BOOST_FUSION_ADAPT_IS_TPL(TEMPLATE_PARAMS_SEQ) \ + BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) + +#endif From 960ccf5d2c16b09a9559d220cdb3dd18ac48c0f4 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sat, 21 Feb 2015 19:15:49 +0900 Subject: [PATCH 82/85] Fix dead links: caused by pull-request #51. --- doc/container.qbk | 12 ++++++------ doc/fusion.qbk | 2 +- doc/notes.qbk | 2 +- doc/support.qbk | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/container.qbk b/doc/container.qbk index 571c7f0a..427b6284 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -730,7 +730,7 @@ before including any Fusion header to change the default. Example: [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -778,7 +778,7 @@ __result_of_make_cons__`::type` [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -828,7 +828,7 @@ default. Example: [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -880,7 +880,7 @@ Fusion header to change the default. Example: [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -932,7 +932,7 @@ default. Example: [heading See also] -__note_boost_ref__ +__note_ref_wrappers__ [endsect] @@ -990,7 +990,7 @@ default. Example: [heading See also] -__note_boost_ref__, __fusion_pair__ +__note_ref_wrappers__, __fusion_pair__ [endsect] diff --git a/doc/fusion.qbk b/doc/fusion.qbk index 829979e6..0ca7919c 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -331,7 +331,7 @@ [def __tag_dispatching__ [link fusion.notes.tag_dispatching /tag dispatching/]] [def __element_conversion__ [link fusion.notes.element_conversion /element conversion/]] [def __see_element_conversion__ [link fusion.notes.element_conversion /see element conversion/]] -[def __note_boost_ref__ [link fusion.notes.boost__ref `boost::ref`]] +[def __note_ref_wrappers__ [link fusion.notes.reference_wrappers `Reference Wrappers`]] [def __quick_start__ [link fusion.quick_start Quick Start]] [def __organization__ [link fusion.organization Organization]] diff --git a/doc/notes.qbk b/doc/notes.qbk index 0377023c..02b1437f 100644 --- a/doc/notes.qbk +++ b/doc/notes.qbk @@ -100,7 +100,7 @@ Array arguments are deduced to reference to const types. For example [footnote Note that the type of a string literal is an array of const characters, not `const char*`. To get __make_list__ to create a __list__ with an element of a non-const array type one must use the `ref` wrapper -(see __note_boost_ref__).]: +(see __note_ref_wrappers__).]: __make_list__("Donald", "Daisy") diff --git a/doc/support.qbk b/doc/support.qbk index 1a473819..3e7b7a70 100644 --- a/doc/support.qbk +++ b/doc/support.qbk @@ -254,7 +254,7 @@ Metafunction to apply __element_conversion__ to the full argument type. It removes references to `const`, references to array types are kept, even if the array is `const`. Reference wrappers are removed (see -__note_boost_ref__)[footnote Since C++11, the standard reference wrappers +__note_ref_wrappers__)[footnote Since C++11, the standard reference wrappers are also removed.]. [heading Header] From 06428298bbb5180979f8e658dc896702c1b7e92d Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sat, 21 Feb 2015 19:16:13 +0900 Subject: [PATCH 83/85] Add docs for std::tuple adaptation. --- doc/adapted.qbk | 33 +++++++++++++++++++++++++++++++-- doc/fusion.qbk | 1 + doc/html/index.html | 1 + 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/doc/adapted.qbk b/doc/adapted.qbk index 9fd6c24a..a370e373 100644 --- a/doc/adapted.qbk +++ b/doc/adapted.qbk @@ -89,6 +89,35 @@ __std_pair_doc__, __tr1_tuple_pair__ [endsect] +[section std::tuple] + +This module provides adapters for `std::tuple`. Including the module header +makes `std::tuple` a fully conforming __random_access_sequence__. + +[important To be fully conforming, compiler should support C++11 Variadic Templates.] + +[heading Header] + + #include + #include + +[heading Model of] + +* __random_access_sequence__ + +[heading Example] + + std::tuple p(123, "Hola!!!", 456.f); + std::cout << __at_c__<0>(p) << std::endl; + std::cout << __at_c__<1>(p) << std::endl; + std::cout << p << std::endl; + +[heading See also] + +__std_tuple_doc__ + +[endsect] + [section mpl sequence] This module provides adapters for __mpl__ sequences. Including the module @@ -168,8 +197,8 @@ header makes `boost::tuple` a fully conforming __forward_sequence__. [heading Example] boost::tuple example_tuple(101, "hello"); - std::cout << *boost::fusion::begin(example_tuple) << '\n'; - std::cout << *boost::fusion::next(boost::fusion::begin(example_tuple)) << '\n'; + std::cout << *__begin__(example_tuple) << '\n'; + std::cout << *__next__(__begin__(example_tuple)) << '\n'; [heading See also] diff --git a/doc/fusion.qbk b/doc/fusion.qbk index 0ca7919c..d47fc9cd 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -55,6 +55,7 @@ [def __boost_func_factory__ [@http://www.boost.org/libs/functional/factory/doc/html/index.html Boost.Functional/Factory]] [def __boost_func_hash__ [@http://www.boost.org/doc/html/hash.html Boost.Functional/Hash]] [def __std_pair_doc__ [@http://www.sgi.com/tech/stl/pair.html `std::pair`]] +[def __std_tuple_doc__ [@http://en.cppreference.com/w/cpp/utility/tuple `std::tuple`]] [def __std_plus_doc__ [@http://www.sgi.com/tech/stl/plus.html `std::plus`]] [def __std_minus_doc__ [@http://www.sgi.com/tech/stl/minus.html `std::minus`]] diff --git a/doc/html/index.html b/doc/html/index.html index 03b417ee..0fd880b6 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -167,6 +167,7 @@
Array
std::pair
+
std::tuple
mpl sequence
boost::array
boost::tuple
From 197792ac538262edb7ff2165ffd4fc7e77b02d7f Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sat, 21 Feb 2015 19:58:15 +0900 Subject: [PATCH 84/85] Conforming admonitions style to quickbook. http://www.boost.org/doc/libs/1_57_0/doc/html/quickbook/syntax/block.html#quickbook.syntax.block.admonitions --- doc/container.qbk | 14 +++++++------- doc/functional.qbk | 4 ++-- doc/fusion.qbk | 5 ----- doc/html/images/alert.png | Bin 603 -> 0 bytes doc/html/images/caution.png | Bin 1250 -> 0 bytes doc/html/images/home.png | Bin 358 -> 0 bytes doc/html/images/important.png | Bin 722 -> 0 bytes doc/html/images/next.png | Bin 336 -> 0 bytes doc/html/images/note.png | Bin 658 -> 0 bytes doc/html/images/prev.png | Bin 334 -> 0 bytes doc/html/images/smiley.png | Bin 867 -> 0 bytes doc/html/images/tip.png | Bin 640 -> 0 bytes doc/html/images/up.png | Bin 370 -> 0 bytes doc/html/images/warning.png | Bin 1241 -> 0 bytes doc/preface.qbk | 15 +++++---------- doc/sequence.qbk | 4 ++-- 16 files changed, 16 insertions(+), 26 deletions(-) delete mode 100755 doc/html/images/alert.png delete mode 100644 doc/html/images/caution.png delete mode 100755 doc/html/images/home.png delete mode 100644 doc/html/images/important.png delete mode 100755 doc/html/images/next.png delete mode 100755 doc/html/images/note.png delete mode 100755 doc/html/images/prev.png delete mode 100755 doc/html/images/smiley.png delete mode 100755 doc/html/images/tip.png delete mode 100755 doc/html/images/up.png delete mode 100644 doc/html/images/warning.png diff --git a/doc/container.qbk b/doc/container.qbk index 427b6284..270b184b 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -191,7 +191,7 @@ defined in __forward_sequence__. [[`__at__(l)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ `__at__(l)` is provided for convenience and compatibility +[note `__at__(l)` is provided for convenience and compatibility with the original __tuple__ library, despite `cons` being a __forward_sequence__ only (`at` is supposed to be a __random_access_sequence__ requirement). The runtime complexity of __at__ is @@ -276,7 +276,7 @@ defined in __forward_sequence__. [[`__at__(l)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ `__at__(l)` is provided for convenience and compatibility +[note `__at__(l)` is provided for convenience and compatibility with the original __tuple__ library, despite `list` being a __forward_sequence__ only (__at__ is supposed to be a __random_access_sequence__ requirement). The runtime complexity of __at__ is @@ -363,7 +363,7 @@ defined in __bidirectional_sequence__. [[`__at__(d)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ `__at__(d)` is provided for convenience, despite +[note `__at__(d)` is provided for convenience, despite `deque` being a __bidirectional_sequence__ only (`at` is supposed to be a __random_access_sequence__ requirement). The runtime complexity of __at__ is constant (see __recursive_inline__). `deque` element access @@ -406,7 +406,7 @@ the same properties as the __deque__. [[`T`] [Element type] [ ]] ] -[blurb __note__ `Deque` can be a __deque__, a __front_extended_deque__ or a +[note `Deque` can be a __deque__, a __front_extended_deque__ or a __back_extended_deque__] [heading Model of] @@ -430,7 +430,7 @@ not defined in __bidirectional_sequence__. [[`__at__(d)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ See __deque__ for further details.] +[note See __deque__ for further details.] [heading Example] @@ -467,7 +467,7 @@ the same properties as the __deque__. [[`T`] [Element type] [ ]] ] -[blurb __note__ `Deque` can be a __deque__, a __back_extended_deque__ or a +[note `Deque` can be a __deque__, a __back_extended_deque__ or a __back_extended_deque__] [heading Model of] @@ -491,7 +491,7 @@ not defined in __bidirectional_sequence__. [[`__at__(d)`] [The Nth element from the beginning of the sequence; see __at__.]] ] -[blurb __note__ See __deque__ for further details.] +[note See __deque__ for further details.] [heading Example] diff --git a/doc/functional.qbk b/doc/functional.qbk index 9bfdaa63..4a8e3d81 100644 --- a/doc/functional.qbk +++ b/doc/functional.qbk @@ -931,11 +931,11 @@ reference. Const qualification is preserved and propagated appropriately the target function object is const - or, in case the target function object is held by value, the adapter is const). -[blurb __note__ For Microsoft Visual C++ 7.1 (Visual Studio 2003) the detection +[note For Microsoft Visual C++ 7.1 (Visual Studio 2003) the detection of the Function Object's const qualification easily causes an internal error. Therefore the adapter is always treated as if it was const. ] -[blurb __tip__ If the type sequence passed to this template contains +[tip If the type sequence passed to this template contains non-reference elements, the element is copied only once - the call operator's signature is optimized automatically to avoid by-value parameters.] diff --git a/doc/fusion.qbk b/doc/fusion.qbk index d47fc9cd..81542f02 100644 --- a/doc/fusion.qbk +++ b/doc/fusion.qbk @@ -20,11 +20,6 @@ ] ] -[def __note__ [$images/note.png]] -[def __alert__ [$images/alert.png]] -[def __tip__ [$images/tip.png]] -[def __caution__ [$images/caution.png]] - [def __spirit__ [@http://spirit.sourceforge.net Spirit]] [def __phoenix__ [@http://www.boost.org/libs/phoenix/index.html Phoenix]] [def __mpl__ [@http://www.boost.org/libs/mpl/index.html MPL]] diff --git a/doc/html/images/alert.png b/doc/html/images/alert.png deleted file mode 100755 index b4645bc7e7cd81f2818bf22aa898e95f89f7b154..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 603 zcmeAS@N?(olHy`uVBq!ia0y~yV31^BU=ZVAW?*1oN<7}ez`(#Bl2vQw%VQUVy#($c(b7<_!Z&&*`7 zwYIFTuIA!kP?6(!`t<3^g$y0J3{Q73WQH(YSjJ#(AQj-}VXe>LZ_gkv$q?hiVP&Xj ztS4or%^)MjpsB?1|Nnp9pi5p13=F0vL4Lvi$p8#BTQ7jZgtNdSvY3H^>jMZgI;}C8 z!N9FSxfgB=H7N+NC77H_+N#nawR{=RqTMBX)(LXL|IjinhDSdCyWWZ3S$0kBOZbahGm>{cU3L4X z*xaKNrl+L*2&>`tT{GF}sK6TCoSy58@94C>csZ@3se0z)OD!J`ePg?KNk!eRu!nuZ zwIuy5g5`UyU*2!`JMiPV^UIVvmW1t{f1*^~1#9h_jDIZO*R6JmbN8&QBXd?)zY=(& z`HG+Mis#k2-hNM1nwI_8efYU@yAuCZhY42|Be;Juo!svFUA16}A_D^hgQu&X%Q~lo FCIA+53ZVc1 diff --git a/doc/html/images/caution.png b/doc/html/images/caution.png deleted file mode 100644 index 5b7809ca4a9c8d778087522e5ce04b6e90099595..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1250 zcmeAS@N?(olHy`uVBq!ia0y~yV2}V|4rT@hhU+WOo?>8NW(e>Jab;j&;NV~o5MYpy zU{F+KFf?Rva$<;zVn|MA$j)XcE@r5%W@u?)XlW_#>0#*UDemd%nKFf8%9P?MQ>y38 zVVEwkZjIWyHF@jSt$X(}?A@Du?i|Cp zbLXyIW4Lzh+_h`h?%iX!chB(NJdh*`E$$X&!4}4&+z{J`|sZwzJC|^ z{$1kxcf;@BzyJTw@c+NS|Nj#IN5NBISn~R-X--a%afBxQ|J!3zMjr_SU zk_iHr)f*lf{$5^Qz}I)@3FlWvw(w~u=1P@VsTP+$RNGvxbHL-(%M6nc6`{zlU zjGQJeveps+!&Jb&mD)L@hA} z1_tL6*NBqf{Irtt#G+IN2MuLS&)mfHRNut(%;anZ6Fnn63k6F{eFF=914D)6qRirw zN{8Ia;*!i{z0_j8l+uFyyb`_S{M?DV6n8K%Fld2|%S_KpEGaEYWk@zRFt#waFg8d` zG)YZPF-fe)lBATd3a!N{b-$VA&f+n^|#(~yCI Ofx*+&&t;ucLK6T%G-N*j diff --git a/doc/html/images/home.png b/doc/html/images/home.png deleted file mode 100755 index 5584aacb097a80e66a5320312b6e4eb017af1a06..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 358 zcmeAS@N?(olHy`uVBq!ia0y~yU=Rjj7G?$phK4%r{|pQa%*9TgAsieWw;%dHU|?WS z3GfMV6&Dfg?(A@OuseF>a6(*+nzF*onKLh6zO-%YmOy{sw6wJU|Nk%gvq74Hfq|za z$S?Rm0x$^OKX;CSfq}EYBeIx*fm;ZK886+f`@_J%pjzS@Q4*Y=R#Ki=l*-_nm|T>f zo0^iDsNj}alvU8YOY t9}F9JU6`43jMG5vNQA&8NcoN_f;wr$vARr(hAt9lu zscC6x>EvV>6{VS+EaBwj6ciMco$ZvI98_E!l$@NLot<4>UER|o(bHqOcQ41TYc{y!?kM?_wFg)yJvXsp5^oB z9Pi&Vyniq7|3Ab3{~Z7S3p{_W`TV)z`}cpO z$(;G%_wGG* z?AW<;=dNA5cJJQ3=g*(NfB*jb_wWDz|6hCQ@I3|w2F4_BcNgdM3%p4T42R|DNig) zWpL0?*7VFxOi%SqOwUZtRxr^s(z8&owA44S&^IttNG{4OE~#|Ltt>9dOx8;+)=McZ z$j>X$OU}=oxJz*d0|SE=*tpE}yu^~yqEv=t diff --git a/doc/html/images/next.png b/doc/html/images/next.png deleted file mode 100755 index 59800b4e87f60c0e3383ede2b384b9be0f5ffe8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 336 zcmeAS@N?(olHy`uVBq!ia0y~yU=Rjj7G?$phK4%r{|pQa%*9TgAsieWw;%dHU|?WS z3GfMV6&Dfg?(8r&Hr}>%OQ656nzF)*4nJa0`Jj)#l9-t%+}PK^d+g590~2^trx_V+aGYt)W#Kgko@Q{~>i6>w}LxPb)_bi1gN;4a>^d{wcURt*495hZOYc8|NsA=8=F$dz`$Tq666>BpLD?B9j=thz`(#+;1OBOz`*qZgc+UI zn9N{cU{Eb_jVKAuPb(=;EJ|hYO-wGz&rMCqOjK~oEJ`iUFUl@f@QqL~GB7Y{FI#h- zfq_xR)5S5QVovU)+hxrP02oy7clOl(|F;(fCx<^{O+3$d{!GJf zAT>%@)+Kac%o^ zm8~at%dZNSg`XDA>HpujeRb(tA@xWH1+`xhu}_a!eJ{ORYJcMi$Ma>cBHv0)HBxa4 zSGC~^nY{G5@1(nj{7!xJ-s1V$LbWCK_xDFLe3_MRf4msHv}xJrfBaF7=BYjUcQ!FF PFfe$!`njxgN@xNAS|c%7 diff --git a/doc/html/images/prev.png b/doc/html/images/prev.png deleted file mode 100755 index d88a40f923e3c554125f01cd366707c60cfcad04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 334 zcmeAS@N?(olHy`uVBq!ia0y~yU=Rjj7G?$phK4%r{|pQa%*9TgAsieWw;%dHU|?WS z3GfMV6&DdqOG`60Hr}>%%ZlYo1O0u~loc*tzSP~>;p||S5Et|R|Noh1c$yg)73T~N2spa`a*~JRJ5eh~I1}5!gYtAz;Fo=OPI2WZRmSpDVDTHL^rZN~B=o=X8 z8<-ql-^0nkz!2u?;uumfC;0|1OPoRyGxLNShYX~Tl_Wf9G1_imu)%RA9}mw<0X2^e zQioc&m}WXSvRw^OFi2qFa&lm1W^U?K=~^Ook|m{hVvche^Q6-g?(V)Vn8U=toEqFE UkjD9gfq{X+)78&qol`;+00?PtqyPW_ diff --git a/doc/html/images/smiley.png b/doc/html/images/smiley.png deleted file mode 100755 index 30a77f71ce16872d046a1a5d6fd698a2f65a3f62..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 867 zcmeAS@N?(olHy`uVBq!ia0y~yU=U|uV36QoW?*1YTQtp`fq{X!*vT`5gM;JtL;nX1 z42*&SJ|V8+B7&<|tz5IBw4@*~EXexT*H!m!O?Pp!sH>^CckiyDuKJ|Dl+(w%CQay1 zOYu8%=FGd73zHKgmoF}|u{3I~kKDVXVbQ_`9c`_Fz7{iQrl~4QMTGi1fByW=jcKLD z*?C#s*_rWAAIx@f)c16=+qAB-t1T`u&hzVsWjnTSn>lml<@5cSX&!B@jUfSci{|F_ z_w^KKXB!)+#6)_3`t<4gwQEt~&MzL%J+!ao-_JD<@64PzGws6Z-hv$8-Me=7btN{` zl~t96rKP3$c$&I9TcsogXQl?mL%y{W;-5&-92C)*?h!W?b)Wnj^{5*w_%-mE4Lj!$7BYguC zr{Y6*7#J8-K`Mgt(@M${i&7bU6O)Vbb5m0?6BXPti&D$;i?WLqd?OT$3=B-#%hsG{ zU|`huba4!+n3FrHHoVC|#v<-Y&ynX`2+ z)ci{*-@n^>-frGI_MA-9eHCQCFMs-NiTvCzJ8a&6h<9#D<(d3(^{E}JLTitR9GSK2 z$*O4*8tU!OHS*&Yg~mSMD)7~hd93j+u`cf5MM<4*zJ;yfFKhYEn9bv3Xeg3g;K-G= z;q?Q<5Qk-d*rznCncd{p+umG~t-YZ3L%_f9;YyrSd?k7nE}0j~xg-T!p1r_pXw_8J z^q9XtRP=q)pSk7_!?YePxacL!`8E4~v$oZii_iB4y^t?YSBana!LlH(Q{_whcc+EB z6^^opPM-68`QEg&=hc<^;brIeKBf1+k=uTZ@Aa)4^R8_EExPXM@|~g)-OB%bBP#i` ie0$=QHXfdLO8@!p%oni+1)dBH3=E#GelF{r5}E*N2(Kal diff --git a/doc/html/images/tip.png b/doc/html/images/tip.png deleted file mode 100755 index 9f596b0b88eb42562b2d0b0e30d054509be42af2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 640 zcmeAS@N?(olHy`uVBq!ia0y~yV2}V|4rT@hhU+WOo?>8NU@ms@4B_D5xc$)o0Rsa= zZ-7sTtD>UflSfBq&1}s`kJ`U?skgWH)2B~oOmF`E^TxIg4+D?5M~H-?Y?- zI&~E<1_lQGk|4j}{|LZEaktF(-D? z%Sp`&0xgDm?d}|!0v)M>{a+K-KKU!3@9L8LOa5Z1>0OX+j1SY)GfWc?{l8U z$2VD9PtNu%kvS~%Xw8E;=95FN9-q3V{gPE~*|fjR%QkDRKeb=t2Ll5GgQu&X%Q~lo FCIFO8ExiB$ diff --git a/doc/html/images/up.png b/doc/html/images/up.png deleted file mode 100755 index 17d9c3ec491ae1ba22188ce85985623c92ffa9be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 370 zcmeAS@N?(olHy`uVBq!ia0y~yU=Rjj7G?$phK4%r{|pQa%*9TgAsieWw;%dHU|?X- z3h)VW6&DdqOG|Thu-mqE%ZlYoyE{8BU%nLR@2jS)FmvY2qel)W#Kk;%^zi@x|I?Un z*fKCM@RbDl1^-6|46X<6oM2#J;4JWnEM{Qf76M_$OLy!3FfcHvmbgZg1m~xflqVLY zGWaGY7v<-srer26xMdclmgg5`7c2NiC>R+Sn6#IzInThrAO_OlT$Gwvl9`{U5R#dj z%3x@qZ(yu%U~+tY4<`cyLy@P8V@SoEspmFwHW&!FJyeg_(XezvV9WvAI|r@_>dZZG zPW6aiOT!J--9O?NG0%AP;}ge|4lDQN4=-}8`?JGwx}?mMnO)OdyQdu$nQCjPRV}jm z$u!Qa8E-cQ-r3Nz>Y(YPTd#BPEH+&8GWqfD!}4*53%dA!%#3$cIv;a~fq{X+)78&q Iol`;+0POUaApigX diff --git a/doc/html/images/warning.png b/doc/html/images/warning.png deleted file mode 100644 index 1c33db8f34a8b42b373179b46a2d8d8a10e061a9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1241 zcmeAS@N?(olHy`uVBq!ia0y~yV2}V|4rT@hhU+WOo?>8NW(e>JaphoO5CF?5GB9W| zFc>m0I59AIF)#!%FhnshWHT@nGcZ&$Ftji*^e`|?VPKe2T|Fl#Xiikroa*YO3=B&x zEth(EEp2I8I%UezrAyZ`FswB+TsvjTRtAQxnwndCdbZA)vvujxty{P5WnkF5cJ1D+ zTaPg?91{>YCLwX`*s*gA4Ce#{&Phm|)6~4iz;I1d^V+p*_ZS%N-Mjakf#JEL;`8Uv z-!m}0=iqq%{{43bhVS3M|7T$MKMF=efJz}yVEuRs0|NtNlDE4HLkFv@2Ll7c3r`ov zkcwNmlWOyu3izvS7ejxP>R-!INP5f(XN|IS^C^Iyp?`SUk1vQO?s(K&l| zi|Nkt0@~*ymDp65*E-HED6u(s{Mfrxmah{JrgAMTIq)Du?nC5nnYTRgThA|azEdIl zD^uvV>~q(b?>`Fd;xnAbe7so1I$-&keKN}|vNNOCvX<~g{)wp7{&hR__v^cBU*Gq* zV3YS!cBPWsl#eNWc|~nAXWMOB8tQWBuXo=4>}cytyX_5F^Az{bVJ>7~U~n#RjVKAu zPb(=;EJ|f?&`{R&%uP&B^-WCAOwLv?(KFJsP_VSrH?Yt*FjPn`$}BFabjYnNF3C*R zOD)z*DJ{s)E742N&z-nSaR&nfgBIAh%=Em(lG377hGY|?B=Z!b6jL*k#Ka_13kwTN zLrZf@a|7cv1EVApQ-8txlNlHo_&~Y>64O%|j7%zwOtcNO4T_>U4H+017(8A5T-G@y GGywozG)2h( diff --git a/doc/preface.qbk b/doc/preface.qbk index 635b3bde..2fff963a 100644 --- a/doc/preface.qbk +++ b/doc/preface.qbk @@ -49,16 +49,11 @@ and traversal routines. It was an instant /AHA!/ moment. Some icons are used to mark certain topics indicative of their relevance. These icons precede some text to indicate: -[table Icons - [[Icon] [Name] [Meaning]] - [[__note__] [Note] [Information provided is auxiliary but will - give the reader a deeper insight into a specific - topic. May be skipped.]] - [[__alert__] [Alert] [Information provided is of utmost importance.]] - [[__caution__] [Caution] [A mild warning.]] - [[__tip__] [Tip] [A potentially useful and helpful piece of - information.]] -] +[note Information provided is auxiliary but will give the reader a deeper +insight into a specific topic. May be skipped.] +[important Information provided is of utmost importance.] +[caution A mild warning.] +[tip A potentially useful and helpful piece of information.] This documentation is automatically generated by Boost QuickBook documentation tool. QuickBook can be found in the __boost_tools__. diff --git a/doc/sequence.qbk b/doc/sequence.qbk index 4722124a..5957a6e1 100644 --- a/doc/sequence.qbk +++ b/doc/sequence.qbk @@ -255,7 +255,7 @@ any Random Access Sequence the following must be met: [[`__result_of_value_at_c__::type`] [Amortized constant time]] ] -[blurb __note__ `__result_of_at__` returns the actual type returned by +[note `__result_of_at__` returns the actual type returned by `__at__(s)`. In most cases, this is a reference. Hence, there is no way to know the exact element type using `__result_of_at__`.The element at `M` may actually be a reference to begin with. For this purpose, you can use @@ -330,7 +330,7 @@ For any Associative Sequence the following expressions must be valid: [[`__result_of_value_at_key__::type`] [Amortized constant time]] ] -[blurb __note__ `__result_of_at_key__` returns the actual type returned +[note `__result_of_at_key__` returns the actual type returned by `__at_key__(s)`. In most cases, this is a reference. Hence, there is no way to know the exact element type using `__result_of_at_key__`.The element at `K` may actually be a reference to begin with. For this purpose, From 2114bfca6c8d5e4f7fe2439346e1feddfd550ea6 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Tue, 3 Mar 2015 02:21:02 +0900 Subject: [PATCH 85/85] More constexpr and noexcept support. Note 1: Forwarding functions are specified as a C++14 constexpr since std::forward is not a constexpr within C++11. Note 2: Though I'm not sure why it doesn't compile, some declarations are specified as a C++14 constexpr or non-constexpr. Note 3: Boost.Tuple adaptation and TR1-based tuple implementations are not constexpr. --- .../fusion/adapted/adt/detail/adapt_base.hpp | 28 +++-- .../fusion/adapted/adt/detail/extension.hpp | 6 +- .../boost/fusion/adapted/array/at_impl.hpp | 2 +- .../boost/fusion/adapted/array/begin_impl.hpp | 2 +- .../boost/fusion/adapted/array/deref_impl.hpp | 2 +- .../boost/fusion/adapted/array/end_impl.hpp | 2 +- .../adapted/boost_array/array_iterator.hpp | 8 +- .../adapted/boost_array/detail/at_impl.hpp | 4 +- .../adapted/boost_array/detail/begin_impl.hpp | 6 +- .../adapted/boost_array/detail/end_impl.hpp | 6 +- .../adapted/std_tuple/detail/at_impl.hpp | 2 +- .../adapted/std_tuple/detail/begin_impl.hpp | 2 +- .../std_tuple/detail/build_std_tuple.hpp | 8 +- .../adapted/std_tuple/detail/convert_impl.hpp | 2 +- .../adapted/std_tuple/detail/end_impl.hpp | 2 +- .../adapted/std_tuple/std_tuple_iterator.hpp | 9 +- .../adapted/struct/detail/adapt_base.hpp | 4 +- .../adapted/struct/detail/begin_impl.hpp | 4 +- .../adapted/struct/detail/define_struct.hpp | 20 ++-- .../struct/detail/define_struct_inline.hpp | 25 ++-- .../adapted/struct/detail/deref_impl.hpp | 5 +- .../fusion/adapted/struct/detail/end_impl.hpp | 4 +- .../adapted/struct/detail/proxy_type.hpp | 2 +- .../boost/fusion/algorithm/auxiliary/copy.hpp | 8 +- .../boost/fusion/algorithm/auxiliary/move.hpp | 8 +- .../fusion/algorithm/iteration/accumulate.hpp | 10 +- .../algorithm/iteration/accumulate_fwd.hpp | 8 +- .../algorithm/iteration/detail/for_each.hpp | 22 ++-- .../iteration/detail/segmented_fold.hpp | 6 +- .../iteration/detail/segmented_for_each.hpp | 6 +- .../fusion/algorithm/iteration/for_each.hpp | 10 +- .../algorithm/iteration/for_each_fwd.hpp | 10 +- include/boost/fusion/algorithm/query/all.hpp | 2 +- include/boost/fusion/algorithm/query/any.hpp | 2 +- .../boost/fusion/algorithm/query/count.hpp | 5 +- .../boost/fusion/algorithm/query/count_if.hpp | 5 +- .../fusion/algorithm/query/detail/all.hpp | 32 ++--- .../fusion/algorithm/query/detail/any.hpp | 32 ++--- .../fusion/algorithm/query/detail/count.hpp | 14 +-- .../algorithm/query/detail/count_if.hpp | 20 ++-- .../fusion/algorithm/query/detail/find_if.hpp | 14 +-- .../algorithm/query/detail/segmented_find.hpp | 8 +- .../query/detail/segmented_find_if.hpp | 8 +- include/boost/fusion/algorithm/query/find.hpp | 6 +- .../boost/fusion/algorithm/query/find_fwd.hpp | 6 +- .../boost/fusion/algorithm/query/find_if.hpp | 6 +- .../fusion/algorithm/query/find_if_fwd.hpp | 4 +- include/boost/fusion/algorithm/query/none.hpp | 2 +- .../fusion/algorithm/transformation/clear.hpp | 2 +- .../transformation/detail/replace.hpp | 10 +- .../transformation/detail/replace_if.hpp | 10 +- .../fusion/algorithm/transformation/erase.hpp | 16 +-- .../algorithm/transformation/erase_key.hpp | 2 +- .../algorithm/transformation/filter.hpp | 4 +- .../algorithm/transformation/filter_if.hpp | 4 +- .../algorithm/transformation/flatten.hpp | 4 +- .../algorithm/transformation/insert.hpp | 5 +- .../algorithm/transformation/insert_range.hpp | 2 +- .../fusion/algorithm/transformation/join.hpp | 2 +- .../algorithm/transformation/pop_back.hpp | 10 +- .../algorithm/transformation/pop_front.hpp | 6 +- .../algorithm/transformation/push_back.hpp | 5 +- .../algorithm/transformation/push_front.hpp | 5 +- .../algorithm/transformation/remove.hpp | 2 +- .../algorithm/transformation/remove_if.hpp | 2 +- .../algorithm/transformation/replace.hpp | 5 +- .../algorithm/transformation/replace_if.hpp | 5 +- .../algorithm/transformation/reverse.hpp | 5 +- .../algorithm/transformation/transform.hpp | 4 +- .../fusion/algorithm/transformation/zip.hpp | 2 +- .../container/deque/back_extended_deque.hpp | 7 +- .../boost/fusion/container/deque/convert.hpp | 4 +- .../boost/fusion/container/deque/deque.hpp | 34 +++--- .../fusion/container/deque/deque_iterator.hpp | 8 +- .../fusion/container/deque/detail/at_impl.hpp | 2 +- .../container/deque/detail/begin_impl.hpp | 2 +- .../container/deque/detail/build_deque.hpp | 6 +- .../container/deque/detail/convert_impl.hpp | 3 +- .../container/deque/detail/cpp03/as_deque.hpp | 4 +- .../deque/detail/cpp03/build_deque.hpp | 4 +- .../container/deque/detail/cpp03/deque.hpp | 30 ++--- .../deque/detail/cpp03/deque_forward_ctor.hpp | 6 +- .../deque/detail/cpp03/deque_keyed_values.hpp | 4 +- .../detail/cpp03/deque_keyed_values_call.hpp | 4 +- .../deque/detail/deque_keyed_values.hpp | 8 +- .../container/deque/detail/end_impl.hpp | 2 +- .../container/deque/detail/keyed_element.hpp | 38 +++--- .../container/deque/front_extended_deque.hpp | 6 +- .../fusion/container/generation/cons_tie.hpp | 4 +- .../fusion/container/generation/deque_tie.hpp | 2 +- .../generation/detail/pp_deque_tie.hpp | 2 +- .../generation/detail/pp_make_deque.hpp | 5 +- .../generation/detail/pp_make_map.hpp | 5 +- .../generation/detail/pp_map_tie.hpp | 5 +- .../fusion/container/generation/ignore.hpp | 4 +- .../fusion/container/generation/list_tie.hpp | 2 +- .../fusion/container/generation/make_cons.hpp | 4 +- .../container/generation/make_deque.hpp | 2 +- .../fusion/container/generation/make_list.hpp | 5 +- .../fusion/container/generation/make_map.hpp | 2 +- .../fusion/container/generation/make_set.hpp | 22 +++- .../container/generation/make_vector.hpp | 5 +- .../fusion/container/generation/map_tie.hpp | 2 +- .../fusion/container/generation/pair_tie.hpp | 4 +- .../container/generation/vector_tie.hpp | 2 +- include/boost/fusion/container/list/cons.hpp | 22 ++-- .../fusion/container/list/cons_iterator.hpp | 25 ++-- .../boost/fusion/container/list/convert.hpp | 6 +- .../fusion/container/list/detail/at_impl.hpp | 6 +- .../container/list/detail/begin_impl.hpp | 4 +- .../container/list/detail/build_cons.hpp | 8 +- .../container/list/detail/convert_impl.hpp | 2 +- .../container/list/detail/deref_impl.hpp | 8 +- .../fusion/container/list/detail/end_impl.hpp | 6 +- .../container/list/detail/equal_to_impl.hpp | 2 +- .../list/detail/list_forward_ctor.hpp | 2 +- .../list/detail/list_to_cons_call.hpp | 2 +- .../container/list/detail/next_impl.hpp | 6 +- .../container/list/detail/reverse_cons.hpp | 4 +- .../container/list/detail/value_at_impl.hpp | 4 +- .../container/list/detail/value_of_impl.hpp | 2 +- include/boost/fusion/container/list/list.hpp | 10 +- include/boost/fusion/container/list/nil.hpp | 8 +- .../boost/fusion/container/map/convert.hpp | 10 +- .../fusion/container/map/detail/at_impl.hpp | 4 +- .../container/map/detail/at_key_impl.hpp | 4 +- .../container/map/detail/begin_impl.hpp | 2 +- .../fusion/container/map/detail/build_map.hpp | 6 +- .../container/map/detail/cpp03/as_map.hpp | 4 +- .../container/map/detail/cpp03/at_impl.hpp | 18 +-- .../container/map/detail/cpp03/begin_impl.hpp | 2 +- .../container/map/detail/cpp03/convert.hpp | 4 +- .../map/detail/cpp03/convert_impl.hpp | 2 +- .../map/detail/cpp03/deref_data_impl.hpp | 2 +- .../container/map/detail/cpp03/deref_impl.hpp | 2 +- .../container/map/detail/cpp03/end_impl.hpp | 2 +- .../fusion/container/map/detail/cpp03/map.hpp | 12 +- .../map/detail/cpp03/map_forward_ctor.hpp | 2 +- .../map/detail/cpp03/value_at_impl.hpp | 2 +- .../fusion/container/map/detail/end_impl.hpp | 2 +- .../fusion/container/map/detail/map_impl.hpp | 52 ++++---- include/boost/fusion/container/map/map.hpp | 30 ++--- .../fusion/container/map/map_iterator.hpp | 10 +- .../boost/fusion/container/set/convert.hpp | 4 +- .../fusion/container/set/detail/as_set.hpp | 4 +- .../container/set/detail/begin_impl.hpp | 2 +- .../container/set/detail/convert_impl.hpp | 2 +- .../container/set/detail/deref_impl.hpp | 2 +- .../fusion/container/set/detail/end_impl.hpp | 2 +- .../container/set/detail/set_forward_ctor.hpp | 2 +- include/boost/fusion/container/set/set.hpp | 10 +- .../boost/fusion/container/vector/convert.hpp | 4 +- .../container/vector/detail/advance_impl.hpp | 6 +- .../container/vector/detail/as_vector.hpp | 4 +- .../container/vector/detail/at_impl.hpp | 4 +- .../container/vector/detail/begin_impl.hpp | 6 +- .../container/vector/detail/convert_impl.hpp | 2 +- .../container/vector/detail/deref_impl.hpp | 6 +- .../container/vector/detail/distance_impl.hpp | 4 +- .../container/vector/detail/end_impl.hpp | 6 +- .../container/vector/detail/equal_to_impl.hpp | 2 +- .../container/vector/detail/next_impl.hpp | 4 +- .../container/vector/detail/prior_impl.hpp | 4 +- .../container/vector/detail/value_at_impl.hpp | 2 +- .../container/vector/detail/value_of_impl.hpp | 2 +- .../vector/detail/vector_forward_ctor.hpp | 20 ++++ .../container/vector/detail/vector_n.hpp | 113 +++++++++++++++--- .../boost/fusion/container/vector/vector.hpp | 41 ++++--- .../fusion/container/vector/vector10.hpp | 8 +- .../container/vector/vector_iterator.hpp | 3 +- .../boost/fusion/functional/adapter/fused.hpp | 10 +- .../adapter/fused_function_object.hpp | 10 +- .../functional/adapter/fused_procedure.hpp | 10 +- .../fusion/functional/adapter/unfused.hpp | 15 ++- .../functional/adapter/unfused_typed.hpp | 6 +- .../generation/detail/gen_make_adapter.hpp | 2 +- .../functional/invocation/detail/that_ptr.hpp | 10 +- .../fusion/functional/invocation/invoke.hpp | 26 ++-- .../invocation/invoke_function_object.hpp | 16 +-- .../invocation/invoke_procedure.hpp | 20 ++-- .../sequence/comparison/detail/equal_to.hpp | 8 +- .../sequence/comparison/detail/greater.hpp | 6 +- .../comparison/detail/greater_equal.hpp | 6 +- .../sequence/comparison/detail/less.hpp | 6 +- .../sequence/comparison/detail/less_equal.hpp | 6 +- .../comparison/detail/not_equal_to.hpp | 8 +- .../fusion/sequence/comparison/equal_to.hpp | 4 +- .../fusion/sequence/comparison/greater.hpp | 4 +- .../sequence/comparison/greater_equal.hpp | 4 +- .../boost/fusion/sequence/comparison/less.hpp | 4 +- .../fusion/sequence/comparison/less_equal.hpp | 10 +- .../sequence/comparison/not_equal_to.hpp | 4 +- include/boost/fusion/sequence/convert.hpp | 6 +- include/boost/fusion/support/as_const.hpp | 7 +- .../detail/segmented_fold_until_impl.hpp | 24 ++-- .../boost/fusion/support/iterator_base.hpp | 9 +- include/boost/fusion/support/pair.hpp | 30 ++--- .../fusion/support/segmented_fold_until.hpp | 8 +- .../boost/fusion/support/sequence_base.hpp | 13 +- include/boost/fusion/support/unused.hpp | 36 +++--- .../view/detail/strictest_traversal.hpp | 2 +- .../view/filter_view/detail/begin_impl.hpp | 2 +- .../filter_view/detail/deref_data_impl.hpp | 2 +- .../view/filter_view/detail/end_impl.hpp | 2 +- .../view/filter_view/detail/next_impl.hpp | 2 +- .../fusion/view/filter_view/filter_view.hpp | 6 +- .../view/filter_view/filter_view_iterator.hpp | 2 +- .../fusion/view/flatten_view/flatten_view.hpp | 26 ++-- .../flatten_view/flatten_view_iterator.hpp | 52 ++++---- .../view/iterator_range/detail/at_impl.hpp | 2 +- .../view/iterator_range/detail/begin_impl.hpp | 4 +- .../view/iterator_range/detail/end_impl.hpp | 4 +- .../detail/segmented_iterator_range.hpp | 24 ++-- .../iterator_range/detail/segments_impl.hpp | 2 +- .../view/iterator_range/iterator_range.hpp | 2 +- .../view/joint_view/detail/begin_impl.hpp | 6 +- .../joint_view/detail/deref_data_impl.hpp | 2 +- .../view/joint_view/detail/end_impl.hpp | 2 +- .../view/joint_view/detail/next_impl.hpp | 6 +- .../fusion/view/joint_view/joint_view.hpp | 8 +- .../view/joint_view/joint_view_iterator.hpp | 2 +- .../fusion/view/nview/detail/advance_impl.hpp | 4 +- .../fusion/view/nview/detail/at_impl.hpp | 6 +- .../fusion/view/nview/detail/begin_impl.hpp | 2 +- .../fusion/view/nview/detail/deref_impl.hpp | 2 +- .../view/nview/detail/distance_impl.hpp | 2 +- .../fusion/view/nview/detail/end_impl.hpp | 2 +- .../fusion/view/nview/detail/next_impl.hpp | 2 +- .../fusion/view/nview/detail/nview_impl.hpp | 2 +- .../fusion/view/nview/detail/prior_impl.hpp | 2 +- include/boost/fusion/view/nview/nview.hpp | 11 +- .../fusion/view/nview/nview_iterator.hpp | 3 +- .../repetitive_view/detail/begin_impl.hpp | 2 +- .../repetitive_view/detail/deref_impl.hpp | 2 +- .../view/repetitive_view/detail/end_impl.hpp | 2 +- .../view/repetitive_view/detail/next_impl.hpp | 6 +- .../view/repetitive_view/repetitive_view.hpp | 2 +- .../repetitive_view_iterator.hpp | 6 +- .../view/reverse_view/detail/advance_impl.hpp | 2 +- .../view/reverse_view/detail/at_impl.hpp | 2 +- .../view/reverse_view/detail/begin_impl.hpp | 2 +- .../reverse_view/detail/deref_data_impl.hpp | 2 +- .../view/reverse_view/detail/deref_impl.hpp | 2 +- .../reverse_view/detail/distance_impl.hpp | 2 +- .../view/reverse_view/detail/end_impl.hpp | 2 +- .../view/reverse_view/detail/next_impl.hpp | 2 +- .../view/reverse_view/detail/prior_impl.hpp | 2 +- .../fusion/view/reverse_view/reverse_view.hpp | 6 +- .../reverse_view/reverse_view_iterator.hpp | 2 +- .../view/single_view/detail/advance_impl.hpp | 2 +- .../view/single_view/detail/at_impl.hpp | 2 +- .../view/single_view/detail/begin_impl.hpp | 2 +- .../view/single_view/detail/deref_impl.hpp | 2 +- .../view/single_view/detail/distance_impl.hpp | 2 +- .../view/single_view/detail/end_impl.hpp | 2 +- .../view/single_view/detail/next_impl.hpp | 2 +- .../view/single_view/detail/prior_impl.hpp | 2 +- .../fusion/view/single_view/single_view.hpp | 7 +- .../view/single_view/single_view_iterator.hpp | 3 +- .../transform_view/detail/advance_impl.hpp | 4 +- .../view/transform_view/detail/at_impl.hpp | 4 +- .../view/transform_view/detail/begin_impl.hpp | 4 +- .../view/transform_view/detail/deref_impl.hpp | 4 +- .../transform_view/detail/distance_impl.hpp | 4 +- .../view/transform_view/detail/end_impl.hpp | 4 +- .../view/transform_view/detail/next_impl.hpp | 4 +- .../view/transform_view/detail/prior_impl.hpp | 4 +- .../view/transform_view/transform_view.hpp | 16 +-- .../transform_view_iterator.hpp | 4 +- .../view/zip_view/detail/advance_impl.hpp | 4 +- .../fusion/view/zip_view/detail/at_impl.hpp | 8 +- .../view/zip_view/detail/begin_impl.hpp | 8 +- .../view/zip_view/detail/deref_impl.hpp | 6 +- .../view/zip_view/detail/distance_impl.hpp | 2 +- .../fusion/view/zip_view/detail/end_impl.hpp | 8 +- .../fusion/view/zip_view/detail/next_impl.hpp | 6 +- .../view/zip_view/detail/prior_impl.hpp | 6 +- .../boost/fusion/view/zip_view/zip_view.hpp | 2 +- .../view/zip_view/zip_view_iterator.hpp | 2 +- preprocess/wave.cfg | 2 + 280 files changed, 1107 insertions(+), 935 deletions(-) diff --git a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp index 3de396dd..23673886 100644 --- a/include/boost/fusion/adapted/adt/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/adt/detail/adapt_base.hpp @@ -17,6 +17,12 @@ #include #include +#if defined(BOOST_GCC) +#define BOOST_FUSION_ADT_CONSTEXPR BOOST_CXX14_CONSTEXPR +#else +#define BOOST_FUSION_ADT_CONSTEXPR BOOST_CONSTEXPR +#endif + #define BOOST_FUSION_ADAPT_ADT_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ) \ typename detail::get_identity< \ lvalue \ @@ -40,7 +46,7 @@ > \ { \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static void \ boost_fusion_adapt_adt_impl_set( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj, \ @@ -49,7 +55,7 @@ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \ } \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ @@ -57,7 +63,7 @@ return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ } \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \ boost_fusion_adapt_adt_impl_get( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ @@ -77,14 +83,14 @@ { \ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ explicit \ adt_attribute_proxy( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& o) \ : obj(&o) \ {} \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ type get() const \ { \ return access::adt_attribute_access< \ @@ -93,7 +99,7 @@ >::boost_fusion_adapt_adt_impl_get(*obj); \ } \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ operator type() const \ { \ return get(); \ @@ -113,7 +119,7 @@ { \ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ explicit \ adt_attribute_proxy( \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& o) \ @@ -121,7 +127,7 @@ {} \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ adt_attribute_proxy& \ operator=(Val const& val) \ { \ @@ -132,7 +138,7 @@ return *this; \ } \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ type get() const \ { \ return access::adt_attribute_access< \ @@ -141,7 +147,7 @@ >::boost_fusion_adapt_adt_impl_get(*obj); \ } \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_FUSION_ADT_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ operator type() const \ { \ return get(); \ @@ -181,7 +187,7 @@ > \ type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type \ call(Seq& obj) \ { \ diff --git a/include/boost/fusion/adapted/adt/detail/extension.hpp b/include/boost/fusion/adapted/adt/detail/extension.hpp index 63491180..c7d25895 100644 --- a/include/boost/fusion/adapted/adt/detail/extension.hpp +++ b/include/boost/fusion/adapted/adt/detail/extension.hpp @@ -17,7 +17,7 @@ #include namespace boost { namespace fusion -{ +{ namespace detail { template @@ -25,12 +25,12 @@ namespace boost { namespace fusion : remove_const::type> {}; } - + namespace extension { // Overload as_const() to unwrap adt_attribute_proxy. template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename adt_attribute_proxy::type as_const(const adt_attribute_proxy& proxy) { return proxy.get(); diff --git a/include/boost/fusion/adapted/array/at_impl.hpp b/include/boost/fusion/adapted/array/at_impl.hpp index 084fffc2..369c8e2e 100644 --- a/include/boost/fusion/adapted/array/at_impl.hpp +++ b/include/boost/fusion/adapted/array/at_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { namespace extension add_reference::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/array/begin_impl.hpp b/include/boost/fusion/adapted/array/begin_impl.hpp index 4ffaba01..8ea5a00e 100644 --- a/include/boost/fusion/adapted/array/begin_impl.hpp +++ b/include/boost/fusion/adapted/array/begin_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/array/deref_impl.hpp b/include/boost/fusion/adapted/array/deref_impl.hpp index a7dc7cb9..a5719c3a 100644 --- a/include/boost/fusion/adapted/array/deref_impl.hpp +++ b/include/boost/fusion/adapted/array/deref_impl.hpp @@ -29,7 +29,7 @@ namespace boost { namespace fusion { namespace extension >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/adapted/array/end_impl.hpp b/include/boost/fusion/adapted/array/end_impl.hpp index d36c6b81..e4ab63ce 100644 --- a/include/boost/fusion/adapted/array/end_impl.hpp +++ b/include/boost/fusion/adapted/array/end_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/boost_array/array_iterator.hpp b/include/boost/fusion/adapted/boost_array/array_iterator.hpp index 0e39d457..8d85ba9c 100644 --- a/include/boost/fusion/adapted/boost_array/array_iterator.hpp +++ b/include/boost/fusion/adapted/boost_array/array_iterator.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion typedef mpl::int_ index; typedef Array array_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED array_iterator(Array& a) : array(a) {} @@ -57,7 +57,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const & it) { @@ -72,7 +72,7 @@ namespace boost { namespace fusion typedef typename Iterator::array_type array_type; typedef array_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -95,7 +95,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(I1 const&, I2 const&) { diff --git a/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp b/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp index 15235e8e..e355d022 100644 --- a/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp +++ b/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp @@ -14,7 +14,7 @@ #include namespace boost { namespace fusion { - + struct boost_array_tag; namespace extension @@ -33,7 +33,7 @@ namespace boost { namespace fusion { typename Sequence::const_reference, typename Sequence::reference>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp b/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp index 5e0752c1..8481b765 100644 --- a/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp +++ b/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp @@ -24,11 +24,11 @@ namespace boost { namespace fusion { struct begin_impl { template - struct apply + struct apply { typedef array_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp b/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp index 13ed1e3e..7574b364 100644 --- a/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp +++ b/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp @@ -24,11 +24,11 @@ namespace boost { namespace fusion { struct end_impl { template - struct apply + struct apply { typedef array_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp b/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp index cffd4428..47a20a25 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/at_impl.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp b/include/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp index 33613c20..1d5d392b 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/begin_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef std_tuple_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp b/include/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp index fd96eabf..41e0d434 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/build_std_tuple.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { namespace detail struct build_std_tuple { typedef std::tuple<> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const&, Last const&) { @@ -61,14 +61,14 @@ namespace boost { namespace fusion { namespace detail typedef std::tuple type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type indexed_call(T const& first, std::tuple const& rest, indexed_tuple) { return type(first, std::get(rest)...); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(T const& first, std::tuple const& rest) { @@ -91,7 +91,7 @@ namespace boost { namespace fusion { namespace detail typedef typename push_front::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& f, Last const& l) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp b/include/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp index ee079bed..96b67b11 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/convert_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typedef typename gen::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/adapted/std_tuple/detail/end_impl.hpp b/include/boost/fusion/adapted/std_tuple/detail/end_impl.hpp index 77048698..500b0491 100644 --- a/include/boost/fusion/adapted/std_tuple/detail/end_impl.hpp +++ b/include/boost/fusion/adapted/std_tuple/detail/end_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion static int const size = std::tuple_size::value; typedef std_tuple_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp b/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp index c4d957ea..d5803f9c 100644 --- a/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp +++ b/include/boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp @@ -36,7 +36,8 @@ namespace boost { namespace fusion typename add_const::type, Index> identity; - BOOST_FUSION_GPU_ENABLED explicit std_tuple_iterator(Tuple& tuple) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit std_tuple_iterator(Tuple& tuple) : tuple(tuple) {} Tuple& tuple; @@ -58,7 +59,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& iter) { @@ -73,7 +74,7 @@ namespace boost { namespace fusion typedef typename Iterator::tuple_type tuple_type; typedef std_tuple_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -96,7 +97,7 @@ namespace boost { namespace fusion { typedef mpl::int_ type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const&, Last const&) { diff --git a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp index db702ae1..2a0fcf7c 100644 --- a/include/boost/fusion/adapted/struct/detail/adapt_base.hpp +++ b/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -138,7 +138,7 @@ >::type \ type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type \ call(Seq& seq) \ { \ @@ -158,7 +158,7 @@ { \ typedef char const* type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type \ call() \ { \ diff --git a/include/boost/fusion/adapted/struct/detail/begin_impl.hpp b/include/boost/fusion/adapted/struct/detail/begin_impl.hpp index 9cb68719..f67df3a7 100644 --- a/include/boost/fusion/adapted/struct/detail/begin_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/begin_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { @@ -57,7 +57,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/struct/detail/define_struct.hpp b/include/boost/fusion/adapted/struct/detail/define_struct.hpp index 44d99f06..3b4d1e3f 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct.hpp @@ -62,7 +62,7 @@ ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ self_type& \ operator=(Seq const& seq) \ { \ @@ -121,7 +121,7 @@ ATTRIBUTE_TUPEL_SIZE, \ ATTRIBUTES_SEQ) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME() \ : BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ @@ -130,7 +130,7 @@ ATTRIBUTES_SEQ) \ {} \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(self_type const& other_self) \ : BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ @@ -140,7 +140,7 @@ {} \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(Seq const& seq \ BOOST_PP_IF( \ BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ @@ -160,7 +160,7 @@ #define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ explicit \ NAME(boost::call_traits< \ BOOST_PP_TUPLE_ELEM( \ @@ -173,7 +173,7 @@ #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ explicit \ NAME(typename boost::call_traits< \ typename boost::fusion::detail::get_first_arg< \ @@ -210,7 +210,7 @@ #define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \ @@ -238,7 +238,7 @@ #define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ 1, \ BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \ @@ -280,12 +280,12 @@ NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(Seq const&) \ {} \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ self_type& \ operator=(Seq const& seq) \ { \ 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 d720fcf8..d721feb8 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp @@ -66,6 +66,7 @@ #define BOOST_FUSION_IGNORE_2(ARG1, ARG2) #define BOOST_FUSION_MAKE_COPY_CONSTRUCTOR(NAME, ATTRIBUTES_SEQ) \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(BOOST_PP_SEQ_FOR_EACH_I( \ BOOST_FUSION_MAKE_CONST_REF_PARAM, \ ~, \ @@ -113,7 +114,7 @@ struct deref > \ { \ typedef typename boost_fusion_detail_Sq::t##N##_type TYPE_QUAL& type; \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(CALL_ARG_TYPE, N> const& iter) \ { \ return iter.seq_.BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \ @@ -163,7 +164,7 @@ typename boost_fusion_detail_Sq::t##N##_type& \ >::type type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_Sq& sq) \ { \ return sq. BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \ @@ -208,7 +209,7 @@ result_raw_type \ >::type type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(iterator_raw_type const& iter) \ { \ return boost::fusion::at_c(iter.ref_vec); \ @@ -336,7 +337,7 @@ typedef boost::mpl::int_ index; \ typedef boost_fusion_detail_Seq sequence_type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ BOOST_FUSION_ITERATOR_NAME(NAME)(boost_fusion_detail_Seq& seq) \ : seq_(seq) \ BOOST_FUSION_DEFINE_ITERATOR_WKND_INIT_LIST_ENTRIES( \ @@ -359,7 +360,7 @@ boost_fusion_detail_It::index::value + 1 \ > type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_It const& it) \ { \ return type(it.seq_); \ @@ -374,7 +375,7 @@ boost_fusion_detail_It::index::value - 1 \ > type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_It const& it) \ { \ return type(it.seq_); \ @@ -392,7 +393,7 @@ typename boost_fusion_detail_It1::index \ >::type type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_It1 const& /* it1 */, \ boost_fusion_detail_It2 const& /* it2 */) \ { \ @@ -412,7 +413,7 @@ + boost_fusion_detail_M::value \ > type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_It const& it) \ { \ return type(it.seq_); \ @@ -445,14 +446,14 @@ (NAME, ATTRIBUTES_SEQ) \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(const boost_fusion_detail_Seq& rhs) \ { \ boost::fusion::copy(rhs, *this); \ } \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME& operator=(const boost_fusion_detail_Seq& rhs) \ { \ boost::fusion::copy(rhs, *this); \ @@ -465,7 +466,7 @@ typedef BOOST_FUSION_ITERATOR_NAME(NAME) \ type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_Sq& sq) \ { \ return type(sq); \ @@ -480,7 +481,7 @@ ATTRIBUTES_SEQ_SIZE \ > type; \ \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static type call(boost_fusion_detail_Sq& sq) \ { \ return type(sq); \ diff --git a/include/boost/fusion/adapted/struct/detail/deref_impl.hpp b/include/boost/fusion/adapted/struct/detail/deref_impl.hpp index a3bc9f3e..c53b51a3 100644 --- a/include/boost/fusion/adapted/struct/detail/deref_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/deref_impl.hpp @@ -28,9 +28,8 @@ namespace boost { namespace fusion { namespace extension typedef typename impl::type type; - BOOST_FUSION_GPU_ENABLED - static - type + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + static type call(It const& it) { return impl::call(*it.seq); diff --git a/include/boost/fusion/adapted/struct/detail/end_impl.hpp b/include/boost/fusion/adapted/struct/detail/end_impl.hpp index b17eba71..855be7a4 100644 --- a/include/boost/fusion/adapted/struct/detail/end_impl.hpp +++ b/include/boost/fusion/adapted/struct/detail/end_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { @@ -57,7 +57,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/adapted/struct/detail/proxy_type.hpp b/include/boost/fusion/adapted/struct/detail/proxy_type.hpp index 350137a4..fcee36ee 100644 --- a/include/boost/fusion/adapted/struct/detail/proxy_type.hpp +++ b/include/boost/fusion/adapted/struct/detail/proxy_type.hpp @@ -19,7 +19,7 @@ \ struct NAME \ { \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ NAME(WRAPPED_TYPE& in_obj) \ : obj(in_obj) \ {} \ diff --git a/include/boost/fusion/algorithm/auxiliary/copy.hpp b/include/boost/fusion/algorithm/auxiliary/copy.hpp index 683a5c87..ec240bae 100644 --- a/include/boost/fusion/algorithm/auxiliary/copy.hpp +++ b/include/boost/fusion/algorithm/auxiliary/copy.hpp @@ -34,14 +34,14 @@ namespace boost { namespace fusion typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const&, I2 const&, mpl::true_) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const& src, I2 const& dest, mpl::false_) { @@ -50,7 +50,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const& src, I2 const& dest) { @@ -71,7 +71,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::copy::type copy(Seq1 const& src, Seq2& dest) { diff --git a/include/boost/fusion/algorithm/auxiliary/move.hpp b/include/boost/fusion/algorithm/auxiliary/move.hpp index e7b9c9ae..e20acae5 100644 --- a/include/boost/fusion/algorithm/auxiliary/move.hpp +++ b/include/boost/fusion/algorithm/auxiliary/move.hpp @@ -34,14 +34,14 @@ namespace boost { namespace fusion typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const&, I2 const&, mpl::true_) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const& src, I2 const& dest, mpl::false_) { @@ -50,7 +50,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I1 const& src, I2 const& dest) { @@ -71,7 +71,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::move::type move(Seq1&& src, Seq2& dest) { diff --git a/include/boost/fusion/algorithm/iteration/accumulate.hpp b/include/boost/fusion/algorithm/iteration/accumulate.hpp index 430f9eb5..fe7112e3 100644 --- a/include/boost/fusion/algorithm/iteration/accumulate.hpp +++ b/include/boost/fusion/algorithm/iteration/accumulate.hpp @@ -26,9 +26,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::accumulate @@ -39,9 +38,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::accumulate diff --git a/include/boost/fusion/algorithm/iteration/accumulate_fwd.hpp b/include/boost/fusion/algorithm/iteration/accumulate_fwd.hpp index 06333498..50c4d39d 100644 --- a/include/boost/fusion/algorithm/iteration/accumulate_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/accumulate_fwd.hpp @@ -20,8 +20,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::accumulate @@ -29,8 +29,8 @@ namespace boost { namespace fusion accumulate(Sequence& seq, State const& state, F f); template - BOOST_FUSION_GPU_ENABLED - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::accumulate diff --git a/include/boost/fusion/algorithm/iteration/detail/for_each.hpp b/include/boost/fusion/algorithm/iteration/detail/for_each.hpp index 81b3ab70..0bef5cec 100644 --- a/include/boost/fusion/algorithm/iteration/detail/for_each.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/for_each.hpp @@ -21,14 +21,14 @@ namespace boost { namespace fusion { namespace detail { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each_linear(First const&, Last const&, F const&, mpl::true_) { } - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each_linear(First const& first, Last const& last, F const& f, mpl::false_) { @@ -39,7 +39,7 @@ namespace detail template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each_dispatch(Sequence& seq, F const& f, Tag) { @@ -56,7 +56,7 @@ namespace detail struct for_each_unrolled { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I0 const& i0, F const& f) { f(*i0); @@ -77,7 +77,7 @@ namespace detail struct for_each_unrolled<3> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I0 const& i0, F const& f) { f(*i0); @@ -94,7 +94,7 @@ namespace detail struct for_each_unrolled<2> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I0 const& i0, F const& f) { f(*i0); @@ -108,7 +108,7 @@ namespace detail struct for_each_unrolled<1> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(I0 const& i0, F const& f) { f(*i0); @@ -119,14 +119,14 @@ namespace detail struct for_each_unrolled<0> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static void call(It const&, F const&) { } }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each_dispatch(Sequence& seq, F const& f, random_access_traversal_tag) { @@ -136,7 +136,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each(Sequence& seq, F const& f, mpl::false_) // unsegmented implementation { diff --git a/include/boost/fusion/algorithm/iteration/detail/segmented_fold.hpp b/include/boost/fusion/algorithm/iteration/detail/segmented_fold.hpp index 58aab114..4ff679af 100644 --- a/include/boost/fusion/algorithm/iteration/detail/segmented_fold.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/segmented_fold.hpp @@ -16,7 +16,7 @@ namespace boost { namespace fusion { namespace detail template struct segmented_fold_fun { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit segmented_fold_fun(Fun const& f) : fun(f) {} @@ -29,7 +29,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::fold::type type; typedef mpl::true_ continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const& state, Context const&, segmented_fold_fun const& fun) { return fusion::fold(seq, state, fun.fun); @@ -52,7 +52,7 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(State& state, Sequence& seq, Fun fun) { return fusion::segmented_fold_until(seq, state, segmented_fold_fun(fun)); diff --git a/include/boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp b/include/boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp index a5d6d4be..a32d9dad 100644 --- a/include/boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/segmented_for_each.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion { namespace detail template struct segmented_for_each_fun { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit segmented_for_each_fun(Fun const& f) : fun(f) {} @@ -31,7 +31,7 @@ namespace boost { namespace fusion { namespace detail typedef void_ type; typedef mpl::true_ continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const&, Context const&, segmented_for_each_fun const& fun) { fusion::for_each(seq, fun.fun); @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void for_each(Sequence& seq, F const& f, mpl::true_) // segmented implementation { diff --git a/include/boost/fusion/algorithm/iteration/for_each.hpp b/include/boost/fusion/algorithm/iteration/for_each.hpp index 836f4810..a523c85e 100644 --- a/include/boost/fusion/algorithm/iteration/for_each.hpp +++ b/include/boost/fusion/algorithm/iteration/for_each.hpp @@ -27,9 +27,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , void @@ -40,9 +39,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , void diff --git a/include/boost/fusion/algorithm/iteration/for_each_fwd.hpp b/include/boost/fusion/algorithm/iteration/for_each_fwd.hpp index 44a3d1da..13720ead 100644 --- a/include/boost/fusion/algorithm/iteration/for_each_fwd.hpp +++ b/include/boost/fusion/algorithm/iteration/for_each_fwd.hpp @@ -20,9 +20,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , void @@ -30,9 +29,8 @@ namespace boost { namespace fusion for_each(Sequence& seq, F const& f); template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , void diff --git a/include/boost/fusion/algorithm/query/all.hpp b/include/boost/fusion/algorithm/query/all.hpp index d30d7952..5122af58 100644 --- a/include/boost/fusion/algorithm/query/all.hpp +++ b/include/boost/fusion/algorithm/query/all.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool all(Sequence const& seq, F f) { diff --git a/include/boost/fusion/algorithm/query/any.hpp b/include/boost/fusion/algorithm/query/any.hpp index 4ab97148..e1aad08d 100644 --- a/include/boost/fusion/algorithm/query/any.hpp +++ b/include/boost/fusion/algorithm/query/any.hpp @@ -25,7 +25,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool any(Sequence const& seq, F f) { diff --git a/include/boost/fusion/algorithm/query/count.hpp b/include/boost/fusion/algorithm/query/count.hpp index a86bf4fe..61fc0569 100644 --- a/include/boost/fusion/algorithm/query/count.hpp +++ b/include/boost/fusion/algorithm/query/count.hpp @@ -26,9 +26,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , int diff --git a/include/boost/fusion/algorithm/query/count_if.hpp b/include/boost/fusion/algorithm/query/count_if.hpp index ac44ac64..8ef86b01 100644 --- a/include/boost/fusion/algorithm/query/count_if.hpp +++ b/include/boost/fusion/algorithm/query/count_if.hpp @@ -26,9 +26,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , int diff --git a/include/boost/fusion/algorithm/query/detail/all.hpp b/include/boost/fusion/algorithm/query/detail/all.hpp index 9c7b4c26..e7e1535d 100644 --- a/include/boost/fusion/algorithm/query/detail/all.hpp +++ b/include/boost/fusion/algorithm/query/detail/all.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion { namespace detail { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool linear_all(First const&, Last const&, F const&, mpl::true_) { @@ -29,12 +29,12 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool linear_all(First const& first, Last const& last, F& f, mpl::false_) { typename result_of::deref::type x = *first; - return f(x) && + return f(x) && detail::linear_all( fusion::next(first) , last @@ -43,7 +43,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool all(Sequence const& seq, F f, Tag) { @@ -60,11 +60,11 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) && + return + f(*it) && f(*fusion::advance_c<1>(it))&& f(*fusion::advance_c<2>(it)) && f(*fusion::advance_c<3>(it)) && @@ -76,11 +76,11 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all<3> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) && + return + f(*it) && f(*fusion::advance_c<1>(it)) && f(*fusion::advance_c<2>(it)); } @@ -90,11 +90,11 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all<2> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) && + return + f(*it) && f(*fusion::advance_c<1>(it)); } }; @@ -103,7 +103,7 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all<1> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { return f(*it); @@ -114,7 +114,7 @@ namespace boost { namespace fusion { namespace detail struct unrolled_all<0> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& /*it*/, F /*f*/) { return true; @@ -122,7 +122,7 @@ namespace boost { namespace fusion { namespace detail }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool all(Sequence const& seq, F f, random_access_traversal_tag) { diff --git a/include/boost/fusion/algorithm/query/detail/any.hpp b/include/boost/fusion/algorithm/query/detail/any.hpp index 4e053683..43628eac 100644 --- a/include/boost/fusion/algorithm/query/detail/any.hpp +++ b/include/boost/fusion/algorithm/query/detail/any.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool linear_any(First const&, Last const&, F const&, mpl::true_) { @@ -32,12 +32,12 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool linear_any(First const& first, Last const& last, F& f, mpl::false_) { typename result_of::deref::type x = *first; - return f(x) || + return f(x) || detail::linear_any( fusion::next(first) , last @@ -46,7 +46,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool any(Sequence const& seq, F f, Tag) { @@ -63,11 +63,11 @@ namespace detail struct unrolled_any { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) || + return + f(*it) || f(*fusion::advance_c<1>(it))|| f(*fusion::advance_c<2>(it)) || f(*fusion::advance_c<3>(it)) || @@ -79,11 +79,11 @@ namespace detail struct unrolled_any<3> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) || + return + f(*it) || f(*fusion::advance_c<1>(it)) || f(*fusion::advance_c<2>(it)); } @@ -93,11 +93,11 @@ namespace detail struct unrolled_any<2> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { - return - f(*it) || + return + f(*it) || f(*fusion::advance_c<1>(it)); } }; @@ -106,7 +106,7 @@ namespace detail struct unrolled_any<1> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const& it, F f) { return f(*it); @@ -117,7 +117,7 @@ namespace detail struct unrolled_any<0> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(It const&, F) { return false; @@ -125,7 +125,7 @@ namespace detail }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool any(Sequence const& seq, F f, random_access_traversal_tag) { diff --git a/include/boost/fusion/algorithm/query/detail/count.hpp b/include/boost/fusion/algorithm/query/detail/count.hpp index 5e046f6b..86714ff7 100644 --- a/include/boost/fusion/algorithm/query/detail/count.hpp +++ b/include/boost/fusion/algorithm/query/detail/count.hpp @@ -25,10 +25,10 @@ namespace boost { namespace fusion { namespace detail // T1 is convertible to T2 or vice versa template <> - struct compare_convertible + struct compare_convertible { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(T1 const& x, T2 const& y) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail struct compare_convertible { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(T1 const&, T2 const&) { @@ -53,16 +53,16 @@ namespace boost { namespace fusion { namespace detail struct count_compare { typedef typename detail::call_param::type param; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED count_compare(param in_x) : x(in_x) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED bool - operator()(T2 const& y) + operator()(T2 const& y) const { - return + return compare_convertible< mpl::or_< is_convertible diff --git a/include/boost/fusion/algorithm/query/detail/count_if.hpp b/include/boost/fusion/algorithm/query/detail/count_if.hpp index baf9fe9f..17c67a0b 100644 --- a/include/boost/fusion/algorithm/query/detail/count_if.hpp +++ b/include/boost/fusion/algorithm/query/detail/count_if.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline int linear_count_if(First const&, Last const&, F const&, mpl::true_) { @@ -32,11 +32,11 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline int linear_count_if(First const& first, Last const& last, F& f, mpl::false_) { - int n = + int n = detail::linear_count_if( fusion::next(first) , last @@ -48,7 +48,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline int count_if(Sequence const& seq, F f, Tag) { @@ -65,7 +65,7 @@ namespace detail struct unrolled_count_if { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const& i0, F f) { int ct = unrolled_count_if:: @@ -96,7 +96,7 @@ namespace detail struct unrolled_count_if<3> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const& i0, F f) { int ct = 0; @@ -121,7 +121,7 @@ namespace detail struct unrolled_count_if<2> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const& i0, F f) { int ct = 0; @@ -142,7 +142,7 @@ namespace detail struct unrolled_count_if<1> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const& i0, F f) { int ct = 0; @@ -157,7 +157,7 @@ namespace detail struct unrolled_count_if<0> { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static int call(I0 const&, F) { return 0; @@ -165,7 +165,7 @@ namespace detail }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline int count_if(Sequence const& seq, F f, random_access_traversal_tag) { diff --git a/include/boost/fusion/algorithm/query/detail/find_if.hpp b/include/boost/fusion/algorithm/query/detail/find_if.hpp index 41baab48..b200794a 100644 --- a/include/boost/fusion/algorithm/query/detail/find_if.hpp +++ b/include/boost/fusion/algorithm/query/detail/find_if.hpp @@ -184,7 +184,7 @@ namespace detail type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type recursive_call(Iterator const& iter, mpl::true_) { @@ -192,7 +192,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type recursive_call(Iterator const& iter, mpl::false_) { @@ -200,7 +200,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type recursive_call(Iterator const& iter) { @@ -209,7 +209,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type choose_call(Iterator const& iter, Tag) { @@ -217,7 +217,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type choose_call(Iterator const& iter, random_access_traversal_tag) { @@ -226,7 +226,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type iter_call(Iterator const& iter) { @@ -234,7 +234,7 @@ namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/algorithm/query/detail/segmented_find.hpp b/include/boost/fusion/algorithm/query/detail/segmented_find.hpp index 21c13a46..d8533afe 100644 --- a/include/boost/fusion/algorithm/query/detail/segmented_find.hpp +++ b/include/boost/fusion/algorithm/query/detail/segmented_find.hpp @@ -45,19 +45,19 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const&state, Context const& context, segmented_find_fun) { return call_impl(seq, state, context, continue_type()); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call_impl(Sequence&, State const&state, Context const&, mpl::true_) { return state; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call_impl(Sequence& seq, State const&, Context const& context, mpl::false_) { return fusion::make_segmented_iterator(fusion::find(seq), context); @@ -78,7 +78,7 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return fusion::segmented_fold_until( diff --git a/include/boost/fusion/algorithm/query/detail/segmented_find_if.hpp b/include/boost/fusion/algorithm/query/detail/segmented_find_if.hpp index 798ed085..fd527c73 100644 --- a/include/boost/fusion/algorithm/query/detail/segmented_find_if.hpp +++ b/include/boost/fusion/algorithm/query/detail/segmented_find_if.hpp @@ -45,19 +45,19 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const&state, Context const& context, segmented_find_if_fun) { return call_impl(seq, state, context, continue_type()); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call_impl(Sequence&, State const&state, Context const&, mpl::true_) { return state; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call_impl(Sequence& seq, State const&, Context const& context, mpl::false_) { return fusion::make_segmented_iterator(fusion::find_if(seq), context); @@ -78,7 +78,7 @@ namespace boost { namespace fusion { namespace detail >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return fusion::segmented_fold_until( diff --git a/include/boost/fusion/algorithm/query/find.hpp b/include/boost/fusion/algorithm/query/find.hpp index 56e53c39..41c22fb3 100644 --- a/include/boost/fusion/algorithm/query/find.hpp +++ b/include/boost/fusion/algorithm/query/find.hpp @@ -47,8 +47,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_disable_if< is_const , result_of::find @@ -60,7 +60,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::find::type const find(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/query/find_fwd.hpp b/include/boost/fusion/algorithm/query/find_fwd.hpp index a43b5eac..c4fc0a9f 100644 --- a/include/boost/fusion/algorithm/query/find_fwd.hpp +++ b/include/boost/fusion/algorithm/query/find_fwd.hpp @@ -20,8 +20,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_disable_if< is_const , result_of::find @@ -29,7 +29,7 @@ namespace boost { namespace fusion find(Sequence& seq); template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::find::type const find(Sequence const& seq); }} diff --git a/include/boost/fusion/algorithm/query/find_if.hpp b/include/boost/fusion/algorithm/query/find_if.hpp index c9e50162..38601ebf 100644 --- a/include/boost/fusion/algorithm/query/find_if.hpp +++ b/include/boost/fusion/algorithm/query/find_if.hpp @@ -42,8 +42,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_disable_if< is_const , result_of::find_if @@ -55,7 +55,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::find_if::type const find_if(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/query/find_if_fwd.hpp b/include/boost/fusion/algorithm/query/find_if_fwd.hpp index cbe9e5e9..5c8abd5b 100644 --- a/include/boost/fusion/algorithm/query/find_if_fwd.hpp +++ b/include/boost/fusion/algorithm/query/find_if_fwd.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename lazy_disable_if< is_const @@ -30,7 +30,7 @@ namespace boost { namespace fusion find_if(Sequence& seq); template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::find_if::type const find_if(Sequence const& seq); }} diff --git a/include/boost/fusion/algorithm/query/none.hpp b/include/boost/fusion/algorithm/query/none.hpp index bb554e3b..1fecdbfe 100644 --- a/include/boost/fusion/algorithm/query/none.hpp +++ b/include/boost/fusion/algorithm/query/none.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool none(Sequence const& seq, F f) { diff --git a/include/boost/fusion/algorithm/transformation/clear.hpp b/include/boost/fusion/algorithm/transformation/clear.hpp index de643408..d2e42fe0 100644 --- a/include/boost/fusion/algorithm/transformation/clear.hpp +++ b/include/boost/fusion/algorithm/transformation/clear.hpp @@ -22,7 +22,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::clear::type clear(Sequence const& /*seq*/) { diff --git a/include/boost/fusion/algorithm/transformation/detail/replace.hpp b/include/boost/fusion/algorithm/transformation/detail/replace.hpp index 5a7516ba..88c4faab 100644 --- a/include/boost/fusion/algorithm/transformation/detail/replace.hpp +++ b/include/boost/fusion/algorithm/transformation/detail/replace.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion { namespace detail struct replacer_helper { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static U& call(U& x, T const&, T const&) { @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace detail struct replacer_helper { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static U call(U& x, T const& old_value, T const& new_value) { @@ -44,7 +44,7 @@ namespace boost { namespace fusion { namespace detail template struct replacer { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED replacer(T const& in_old_value, T const& in_new_value) : old_value(in_old_value), new_value(in_new_value) {} @@ -59,9 +59,9 @@ namespace boost { namespace fusion { namespace detail mpl::if_, value, value const&>::type type; }; - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(U const& x) const { diff --git a/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp b/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp index 5b9663b1..2ecff682 100644 --- a/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp +++ b/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion { namespace detail struct replacer_if_helper { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static U& call(U& x, F&, T const&) { @@ -33,7 +33,7 @@ namespace boost { namespace fusion { namespace detail struct replacer_if_helper { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static U call(U& x, F& f, T const& new_value) { @@ -44,7 +44,7 @@ namespace boost { namespace fusion { namespace detail template struct replacer_if { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED replacer_if(F in_f, T const& in_new_value) : f(in_f), new_value(in_new_value) {} @@ -59,9 +59,9 @@ namespace boost { namespace fusion { namespace detail mpl::if_, value, value const&>::type type; }; - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(U const& x) const { diff --git a/include/boost/fusion/algorithm/transformation/erase.hpp b/include/boost/fusion/algorithm/transformation/erase.hpp index 2d220947..0f3b8a15 100644 --- a/include/boost/fusion/algorithm/transformation/erase.hpp +++ b/include/boost/fusion/algorithm/transformation/erase.hpp @@ -38,21 +38,21 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& first, mpl::false_) { return fusion::next(convert_iterator::call(first)); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& first, mpl::true_) { return convert_iterator::call(first); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& first) { @@ -61,7 +61,7 @@ namespace boost { namespace fusion }; struct use_default; - + template struct fusion_default_help : mpl::if_< @@ -71,7 +71,7 @@ namespace boost { namespace fusion > { }; - + template < typename Sequence , typename First @@ -89,7 +89,7 @@ namespace boost { namespace fusion , typename compute_erase_last::type >::type LastType; - + typedef typename convert_iterator::type first_type; typedef typename convert_iterator::type last_type; typedef iterator_range left_type; @@ -99,7 +99,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename lazy_enable_if< traits::is_sequence @@ -122,7 +122,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::erase::type erase(Sequence const& seq, First const& first, Last const& last) { diff --git a/include/boost/fusion/algorithm/transformation/erase_key.hpp b/include/boost/fusion/algorithm/transformation/erase_key.hpp index 43340047..3757f46f 100644 --- a/include/boost/fusion/algorithm/transformation/erase_key.hpp +++ b/include/boost/fusion/algorithm/transformation/erase_key.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::erase_key::type erase_key(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/filter.hpp b/include/boost/fusion/algorithm/transformation/filter.hpp index 2e290e29..2fc62720 100644 --- a/include/boost/fusion/algorithm/transformation/filter.hpp +++ b/include/boost/fusion/algorithm/transformation/filter.hpp @@ -22,9 +22,9 @@ namespace boost { namespace fusion typedef filter_view > type; }; } - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::filter::type filter(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/filter_if.hpp b/include/boost/fusion/algorithm/transformation/filter_if.hpp index 1b9f0d32..ca28e0e8 100644 --- a/include/boost/fusion/algorithm/transformation/filter_if.hpp +++ b/include/boost/fusion/algorithm/transformation/filter_if.hpp @@ -20,9 +20,9 @@ namespace boost { namespace fusion typedef filter_view type; }; } - + template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::filter_if::type filter_if(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/flatten.hpp b/include/boost/fusion/algorithm/transformation/flatten.hpp index 9cd81fa9..e3cfa983 100644 --- a/include/boost/fusion/algorithm/transformation/flatten.hpp +++ b/include/boost/fusion/algorithm/transformation/flatten.hpp @@ -25,13 +25,15 @@ namespace boost { namespace fusion { namespace result_of namespace boost { namespace fusion { template + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::flatten::type flatten(Sequence& view) { return flatten_view(view); } - + template + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::flatten::type flatten(Sequence const& view) { diff --git a/include/boost/fusion/algorithm/transformation/insert.hpp b/include/boost/fusion/algorithm/transformation/insert.hpp index 78590222..44e59653 100644 --- a/include/boost/fusion/algorithm/transformation/insert.hpp +++ b/include/boost/fusion/algorithm/transformation/insert.hpp @@ -41,9 +41,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::insert diff --git a/include/boost/fusion/algorithm/transformation/insert_range.hpp b/include/boost/fusion/algorithm/transformation/insert_range.hpp index 660ed17f..40e64e1f 100644 --- a/include/boost/fusion/algorithm/transformation/insert_range.hpp +++ b/include/boost/fusion/algorithm/transformation/insert_range.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::insert_range::type insert_range(Sequence const& seq, Position const& pos, Range const& range) { diff --git a/include/boost/fusion/algorithm/transformation/join.hpp b/include/boost/fusion/algorithm/transformation/join.hpp index 51af0535..8be49224 100644 --- a/include/boost/fusion/algorithm/transformation/join.hpp +++ b/include/boost/fusion/algorithm/transformation/join.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::join::type join(LhSequence const& lhs, RhSequence const& rhs) { diff --git a/include/boost/fusion/algorithm/transformation/pop_back.hpp b/include/boost/fusion/algorithm/transformation/pop_back.hpp index b20b5003..2f55fa5e 100644 --- a/include/boost/fusion/algorithm/transformation/pop_back.hpp +++ b/include/boost/fusion/algorithm/transformation/pop_back.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion static bool const is_last = IsLast; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pop_back_iterator(Iterator_ const& iterator_base) : base_type(iterator_base) {} @@ -42,7 +42,7 @@ namespace boost { namespace fusion { typedef pop_back_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(BaseIterator const& i) { @@ -94,7 +94,7 @@ namespace boost { namespace fusion typedef pop_back_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -116,7 +116,7 @@ namespace boost { namespace fusion typedef pop_back_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -152,7 +152,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::pop_back::type pop_back(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/pop_front.hpp b/include/boost/fusion/algorithm/transformation/pop_front.hpp index 636ab12c..11b7f6ee 100644 --- a/include/boost/fusion/algorithm/transformation/pop_front.hpp +++ b/include/boost/fusion/algorithm/transformation/pop_front.hpp @@ -20,19 +20,19 @@ namespace boost { namespace fusion template struct pop_front { - typedef + typedef iterator_range< typename next< typename begin::type >::type , typename end::type - > + > type; }; } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::pop_front::type pop_front(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/push_back.hpp b/include/boost/fusion/algorithm/transformation/push_back.hpp index 484425d8..51c2569d 100644 --- a/include/boost/fusion/algorithm/transformation/push_back.hpp +++ b/include/boost/fusion/algorithm/transformation/push_back.hpp @@ -27,9 +27,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::push_back diff --git a/include/boost/fusion/algorithm/transformation/push_front.hpp b/include/boost/fusion/algorithm/transformation/push_front.hpp index bda056b1..a1b7b390 100644 --- a/include/boost/fusion/algorithm/transformation/push_front.hpp +++ b/include/boost/fusion/algorithm/transformation/push_front.hpp @@ -27,9 +27,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename lazy_enable_if< traits::is_sequence , result_of::push_front diff --git a/include/boost/fusion/algorithm/transformation/remove.hpp b/include/boost/fusion/algorithm/transformation/remove.hpp index 18dfd1d6..f8bebf70 100644 --- a/include/boost/fusion/algorithm/transformation/remove.hpp +++ b/include/boost/fusion/algorithm/transformation/remove.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::remove::type remove(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/remove_if.hpp b/include/boost/fusion/algorithm/transformation/remove_if.hpp index 40248839..5497e3a3 100644 --- a/include/boost/fusion/algorithm/transformation/remove_if.hpp +++ b/include/boost/fusion/algorithm/transformation/remove_if.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::remove_if::type remove_if(Sequence const& seq) { diff --git a/include/boost/fusion/algorithm/transformation/replace.hpp b/include/boost/fusion/algorithm/transformation/replace.hpp index a0a9885b..4d754cc0 100644 --- a/include/boost/fusion/algorithm/transformation/replace.hpp +++ b/include/boost/fusion/algorithm/transformation/replace.hpp @@ -25,9 +25,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , typename result_of::replace::type diff --git a/include/boost/fusion/algorithm/transformation/replace_if.hpp b/include/boost/fusion/algorithm/transformation/replace_if.hpp index da3557aa..8a2bddc6 100644 --- a/include/boost/fusion/algorithm/transformation/replace_if.hpp +++ b/include/boost/fusion/algorithm/transformation/replace_if.hpp @@ -26,9 +26,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , typename result_of::replace_if::type diff --git a/include/boost/fusion/algorithm/transformation/reverse.hpp b/include/boost/fusion/algorithm/transformation/reverse.hpp index 384224d9..53de417a 100644 --- a/include/boost/fusion/algorithm/transformation/reverse.hpp +++ b/include/boost/fusion/algorithm/transformation/reverse.hpp @@ -24,9 +24,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - inline - typename + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename enable_if< traits::is_sequence , reverse_view diff --git a/include/boost/fusion/algorithm/transformation/transform.hpp b/include/boost/fusion/algorithm/transformation/transform.hpp index 94e45460..6a487ccc 100644 --- a/include/boost/fusion/algorithm/transformation/transform.hpp +++ b/include/boost/fusion/algorithm/transformation/transform.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::transform::type transform(Sequence const& seq, F f) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::transform::type transform(Sequence1 const& seq1, Sequence2 const& seq2, F f) { diff --git a/include/boost/fusion/algorithm/transformation/zip.hpp b/include/boost/fusion/algorithm/transformation/zip.hpp index 796ec9e3..e94efc81 100644 --- a/include/boost/fusion/algorithm/transformation/zip.hpp +++ b/include/boost/fusion/algorithm/transformation/zip.hpp @@ -101,7 +101,7 @@ namespace boost { namespace fusion #define FUSION_REF_PARAM(z, n, data) const T ## n& template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::zip::type zip(BOOST_PP_ENUM_BINARY_PARAMS(ZIP_ITERATION, T, const& t)) { diff --git a/include/boost/fusion/container/deque/back_extended_deque.hpp b/include/boost/fusion/container/deque/back_extended_deque.hpp index 206b9285..04b1d41f 100644 --- a/include/boost/fusion/container/deque/back_extended_deque.hpp +++ b/include/boost/fusion/container/deque/back_extended_deque.hpp @@ -8,6 +8,7 @@ #if !defined(BOOST_FUSION_BACK_EXTENDED_DEQUE_26112006_2209) #define BOOST_FUSION_BACK_EXTENDED_DEQUE_26112006_2209 +#include #include #include @@ -28,20 +29,20 @@ namespace boost { namespace fusion typedef mpl::int_<(result_of::size::value + 1)> size; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED back_extended_deque(Deque const& deque, Arg const& val) : base(val, deque) {} #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED back_extended_deque(Deque const& deque, Arg& val) : base(val, deque) {} #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED back_extended_deque(Deque const& deque, Arg&& val) : base(BOOST_FUSION_FWD_ELEM(Arg, val), deque) {} diff --git a/include/boost/fusion/container/deque/convert.hpp b/include/boost/fusion/container/deque/convert.hpp index f791519d..9a4bf01a 100644 --- a/include/boost/fusion/container/deque/convert.hpp +++ b/include/boost/fusion/container/deque/convert.hpp @@ -39,7 +39,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_deque::type as_deque(Sequence& seq) { @@ -48,7 +48,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_deque::type as_deque(Sequence const& seq) { diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index ffb1277e..96919052 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -54,16 +54,16 @@ namespace boost { namespace fusion typedef mpl::false_ is_view; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(Sequence const&, typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty>>::type* /*dummy*/ = 0) + , result_of::empty>>::type* /*dummy*/ = 0) BOOST_NOEXCEPT {} - BOOST_FUSION_GPU_ENABLED - deque() {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + deque() BOOST_NOEXCEPT {} }; template @@ -79,14 +79,14 @@ namespace boost { namespace fusion typedef mpl::int_<-1> next_down; typedef mpl::false_ is_view; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() {} template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque const& seq) : base(seq) {} @@ -94,7 +94,7 @@ namespace boost { namespace fusion template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque& seq) : base(seq) {} @@ -103,25 +103,25 @@ namespace boost { namespace fusion template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque&& seq) : base(std::forward>(seq)) {} #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque const& seq) : base(seq) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque&& seq) : base(std::forward(seq)) {} #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(typename detail::call_param::type head , typename detail::call_param::type... tail) : base(detail::deque_keyed_values::construct(head, tail...)) @@ -131,7 +131,7 @@ namespace boost { namespace fusion template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(Head_&& head, Tail_&&... tail) : base(detail::deque_keyed_values ::forward_(BOOST_FUSION_FWD_ELEM(Head_, head), BOOST_FUSION_FWD_ELEM(Tail_, tail)...)) @@ -140,21 +140,21 @@ namespace boost { namespace fusion template >::type > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(Head_ const& head, Tail_ const&... tail) : base(detail::deque_keyed_values::construct(head, tail...)) {} #endif template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(Sequence const& seq , typename disable_if >::type* /*dummy*/ = 0) : base(base::from_iterator(fusion::begin(seq))) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(deque const& rhs) { base::operator=(rhs); @@ -162,7 +162,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(T const& rhs) { base::operator=(rhs); @@ -171,7 +171,7 @@ namespace boost { namespace fusion #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(T&& rhs) { base::operator=(BOOST_FUSION_FWD_ELEM(T, rhs)); diff --git a/include/boost/fusion/container/deque/deque_iterator.hpp b/include/boost/fusion/container/deque/deque_iterator.hpp index f603b545..e9a79de2 100644 --- a/include/boost/fusion/container/deque/deque_iterator.hpp +++ b/include/boost/fusion/container/deque/deque_iterator.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion { typedef Seq sequence; typedef mpl::int_ index; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque_iterator(Seq& seq) : seq_(seq) {} @@ -54,7 +54,7 @@ namespace boost { namespace fusion { add_const, mpl::identity >::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { @@ -69,7 +69,7 @@ namespace boost { namespace fusion { typedef typename Iterator::sequence sequence; typedef deque_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -96,7 +96,7 @@ namespace boost { namespace fusion { >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(I1 const&, I2 const&) { diff --git a/include/boost/fusion/container/deque/detail/at_impl.hpp b/include/boost/fusion/container/deque/detail/at_impl.hpp index 4c5ffa94..3edf4829 100644 --- a/include/boost/fusion/container/deque/detail/at_impl.hpp +++ b/include/boost/fusion/container/deque/detail/at_impl.hpp @@ -54,7 +54,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return seq.get(adjusted_index()); diff --git a/include/boost/fusion/container/deque/detail/begin_impl.hpp b/include/boost/fusion/container/deque/detail/begin_impl.hpp index c4eed54f..27b4f41b 100644 --- a/include/boost/fusion/container/deque/detail/begin_impl.hpp +++ b/include/boost/fusion/container/deque/detail/begin_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion deque_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return type(seq); diff --git a/include/boost/fusion/container/deque/detail/build_deque.hpp b/include/boost/fusion/container/deque/detail/build_deque.hpp index d555c6c6..4dd990ae 100644 --- a/include/boost/fusion/container/deque/detail/build_deque.hpp +++ b/include/boost/fusion/container/deque/detail/build_deque.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion { namespace detail struct build_deque { typedef deque<> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const&, Last const&) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail { typedef deque type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(T const& first, deque const& rest) { @@ -64,7 +64,7 @@ namespace boost { namespace fusion { namespace detail typedef typename push_front::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& f, Last const& l) { diff --git a/include/boost/fusion/container/deque/detail/convert_impl.hpp b/include/boost/fusion/container/deque/detail/convert_impl.hpp index f8ff5429..ba9b8477 100644 --- a/include/boost/fusion/container/deque/detail/convert_impl.hpp +++ b/include/boost/fusion/container/deque/detail/convert_impl.hpp @@ -37,7 +37,8 @@ namespace boost { namespace fusion { typedef result_of::as_deque gen; typedef typename gen::type type; - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return gen::call(seq); diff --git a/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp index 173a4924..e95daf3a 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/as_deque.hpp @@ -38,7 +38,7 @@ BOOST_FUSION_BARRIER_BEGIN }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator) { @@ -124,7 +124,7 @@ BOOST_FUSION_BARRIER_END }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator const& i0) { diff --git a/include/boost/fusion/container/deque/detail/cpp03/build_deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/build_deque.hpp index 74d37faa..99cbe584 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/build_deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/build_deque.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_deque::type as_deque(Sequence& seq) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_deque::type as_deque(Sequence const& seq) { diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp index 1b92ceaf..b5bacbcf 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque.hpp @@ -79,34 +79,34 @@ namespace boost { namespace fusion { #include - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(typename detail::call_param::type t0) : base(t0, detail::nil_keyed_element()) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(deque const& rhs) : base(rhs) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque const& seq) : base(seq) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(Sequence const& seq, typename disable_if >::type* /*dummy*/ = 0) : base(base::from_iterator(fusion::begin(seq))) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(deque const& rhs) { @@ -115,7 +115,7 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(T const& rhs) { @@ -129,23 +129,23 @@ 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_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(T0_&& t0 , typename enable_if >::type* /*dummy*/ = 0 ) : base(BOOST_FUSION_FWD_ELEM(T0_, t0), detail::nil_keyed_element()) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit deque(deque&& rhs) : base(std::forward(rhs)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(deque&& seq) : base(std::forward>(seq)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque& operator=(T&& rhs) { @@ -170,16 +170,16 @@ FUSION_HASH endif typedef mpl::false_ is_view; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(Sequence const&, typename enable_if< mpl::and_< traits::is_sequence - , result_of::empty > >::type* /*dummy*/ = 0) + , result_of::empty > >::type* /*dummy*/ = 0) BOOST_NOEXCEPT {} - BOOST_FUSION_GPU_ENABLED - deque() {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + deque() BOOST_NOEXCEPT {} }; }} diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp index 277811ec..eeaa29ff 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque_forward_ctor.hpp @@ -35,7 +35,7 @@ FUSION_HASH if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #endif #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) -BOOST_FUSION_GPU_ENABLED +BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param::type t)) : base(detail::deque_keyed_values::construct(BOOST_PP_ENUM_PARAMS(N, t))) {} @@ -49,13 +49,13 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #endif #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) -BOOST_FUSION_GPU_ENABLED +BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& t)) : base(detail::deque_keyed_values::construct(BOOST_PP_ENUM_PARAMS(N, t))) {} template -BOOST_FUSION_GPU_ENABLED +BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T_, && t)) : base(detail::deque_keyed_values:: forward_(BOOST_PP_ENUM(N, FUSION_DEQUE_FORWARD_CTOR_FORWARD, _))) 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 1ee91ba2..21b49345 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 @@ -68,13 +68,13 @@ namespace boost { namespace fusion { namespace detail { typedef nil_keyed_element type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type construct() { return type(); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type forward_() { return type(); diff --git a/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp b/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp index 8ba7eba0..87f3714b 100644 --- a/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03/deque_keyed_values_call.hpp @@ -34,7 +34,7 @@ #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type construct(BOOST_PP_ENUM_BINARY_PARAMS(N, typename detail::call_param::type t)) { return type(t0, @@ -52,7 +52,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_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type forward_(BOOST_PP_ENUM_BINARY_PARAMS(N, T_, && t)) { return type(BOOST_FUSION_FWD_ELEM(T_0, t0), diff --git a/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp index efb2b90d..7c6df7b6 100644 --- a/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp +++ b/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp @@ -28,7 +28,7 @@ namespace boost { namespace fusion { namespace detail typedef typename deque_keyed_values_impl::type tail; typedef keyed_element type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type construct( typename detail::call_param::type head , typename detail::call_param::type... tail) @@ -40,7 +40,7 @@ namespace boost { namespace fusion { namespace detail } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type forward_(Head_&& head, Tail_&&... tail) { return type( @@ -59,11 +59,11 @@ namespace boost { namespace fusion { namespace detail { typedef nil_keyed_element type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type construct() { return type(); } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type forward_() { return type(); } #endif }; diff --git a/include/boost/fusion/container/deque/detail/end_impl.hpp b/include/boost/fusion/container/deque/detail/end_impl.hpp index 4ea344a9..8f67ff4a 100644 --- a/include/boost/fusion/container/deque/detail/end_impl.hpp +++ b/include/boost/fusion/container/deque/detail/end_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion deque_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return type(seq); diff --git a/include/boost/fusion/container/deque/detail/keyed_element.hpp b/include/boost/fusion/container/deque/detail/keyed_element.hpp index 37aba9fd..834ef152 100644 --- a/include/boost/fusion/container/deque/detail/keyed_element.hpp +++ b/include/boost/fusion/container/deque/detail/keyed_element.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { namespace detail void get(); template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static nil_keyed_element from_iterator(It const&) { @@ -43,7 +43,7 @@ namespace boost { namespace fusion { namespace detail using Rest::get; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static keyed_element from_iterator(It const& it) { @@ -51,13 +51,13 @@ namespace boost { namespace fusion { namespace detail *it, base::from_iterator(fusion::next(it))); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element(keyed_element const& rhs) : Rest(rhs.get_base()), value_(rhs.value_) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element(keyed_element&& rhs) : Rest(BOOST_FUSION_FWD_ELEM(Rest, rhs.forward_base())) , value_(BOOST_FUSION_FWD_ELEM(Value, rhs.value_)) @@ -65,7 +65,7 @@ namespace boost { namespace fusion { namespace detail #endif template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element(keyed_element const& rhs) : Rest(rhs.get_base()), value_(rhs.value_) {} @@ -73,39 +73,39 @@ namespace boost { namespace fusion { namespace detail #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #endif - BOOST_FUSION_GPU_ENABLED - Rest& get_base() + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + Rest& get_base() BOOST_NOEXCEPT { return *this; } - BOOST_FUSION_GPU_ENABLED - Rest const& get_base() const + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + Rest const& get_base() const BOOST_NOEXCEPT { return *this; } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED - Rest&& forward_base() + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + Rest&& forward_base() BOOST_NOEXCEPT { return BOOST_FUSION_FWD_ELEM(Rest, *static_cast(this)); } #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename cref_result::type get(Key) const { return value_; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename ref_result::type get(Key) { return value_; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element( typename detail::call_param::type value , Rest const& rest) @@ -113,20 +113,20 @@ namespace boost { namespace fusion { namespace detail {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element(Value&& value, Rest&& rest) : Rest(BOOST_FUSION_FWD_ELEM(Rest, rest)) , value_(BOOST_FUSION_FWD_ELEM(Value, value)) {} #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element() : Rest(), value_() {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element& operator=(keyed_element const& rhs) { base::operator=(static_cast(rhs)); // cast for msvc-7.1 @@ -134,7 +134,7 @@ namespace boost { namespace fusion { namespace detail return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element& operator=(keyed_element const& rhs) { base::operator=(rhs); @@ -143,7 +143,7 @@ namespace boost { namespace fusion { namespace detail } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED keyed_element& operator=(keyed_element&& rhs) { base::operator=(std::forward(rhs)); diff --git a/include/boost/fusion/container/deque/front_extended_deque.hpp b/include/boost/fusion/container/deque/front_extended_deque.hpp index 48f1574a..ab4cdf7c 100644 --- a/include/boost/fusion/container/deque/front_extended_deque.hpp +++ b/include/boost/fusion/container/deque/front_extended_deque.hpp @@ -27,20 +27,20 @@ namespace boost { namespace fusion typedef mpl::int_<(result_of::size::value + 1)> size; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED front_extended_deque(Deque const& deque, Arg const& val) : base(val, deque) {} #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED front_extended_deque(Deque const& deque, Arg& val) : base(val, deque) {} #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED front_extended_deque(Deque const& deque, Arg&& val) : base(BOOST_FUSION_FWD_ELEM(Arg, val), deque) {} diff --git a/include/boost/fusion/container/generation/cons_tie.hpp b/include/boost/fusion/container/generation/cons_tie.hpp index 5987fd5f..2058ebf5 100644 --- a/include/boost/fusion/container/generation/cons_tie.hpp +++ b/include/boost/fusion/container/generation/cons_tie.hpp @@ -25,7 +25,7 @@ namespace boost { namespace fusion // $$$ do we really want a cons_tie? $$$ template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline cons cons_tie(Car& car) { @@ -34,7 +34,7 @@ namespace boost { namespace fusion // $$$ do we really want a cons_tie? $$$ template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline cons cons_tie(Car& car, Cdr const& cdr) { diff --git a/include/boost/fusion/container/generation/deque_tie.hpp b/include/boost/fusion/container/generation/deque_tie.hpp index 727d984f..8b6b9e7b 100644 --- a/include/boost/fusion/container/generation/deque_tie.hpp +++ b/include/boost/fusion/container/generation/deque_tie.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline deque deque_tie(T&... arg) { diff --git a/include/boost/fusion/container/generation/detail/pp_deque_tie.hpp b/include/boost/fusion/container/generation/detail/pp_deque_tie.hpp index eee53151..9146118e 100644 --- a/include/boost/fusion/container/generation/detail/pp_deque_tie.hpp +++ b/include/boost/fusion/container/generation/detail/pp_deque_tie.hpp @@ -89,7 +89,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline deque deque_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & arg)) { diff --git a/include/boost/fusion/container/generation/detail/pp_make_deque.hpp b/include/boost/fusion/container/generation/detail/pp_make_deque.hpp index 6f75fa4a..5635c73c 100644 --- a/include/boost/fusion/container/generation/detail/pp_make_deque.hpp +++ b/include/boost/fusion/container/generation/detail/pp_make_deque.hpp @@ -57,7 +57,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline deque<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline deque<> make_deque() { return deque<>(); @@ -102,7 +103,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline deque make_deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& arg)) { diff --git a/include/boost/fusion/container/generation/detail/pp_make_map.hpp b/include/boost/fusion/container/generation/detail/pp_make_map.hpp index aef5fe40..ad20cd4d 100644 --- a/include/boost/fusion/container/generation/detail/pp_make_map.hpp +++ b/include/boost/fusion/container/generation/detail/pp_make_map.hpp @@ -59,7 +59,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline map<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline map<> make_map() { return map<>(); @@ -116,7 +117,7 @@ namespace boost { namespace fusion BOOST_PP_ENUM_PARAMS(N, typename K) , BOOST_PP_ENUM_PARAMS(N, typename D) > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline map make_map(BOOST_PP_ENUM_BINARY_PARAMS(N, D, const& arg)) { diff --git a/include/boost/fusion/container/generation/detail/pp_map_tie.hpp b/include/boost/fusion/container/generation/detail/pp_map_tie.hpp index 8fde3409..1a53c919 100644 --- a/include/boost/fusion/container/generation/detail/pp_map_tie.hpp +++ b/include/boost/fusion/container/generation/detail/pp_map_tie.hpp @@ -62,7 +62,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline map<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline map<> map_tie() { return map<>(); @@ -119,7 +120,7 @@ namespace boost { namespace fusion BOOST_PP_ENUM_PARAMS(N, typename K) , BOOST_PP_ENUM_PARAMS(N, typename D) > - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline map map_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, D, & arg)) { diff --git a/include/boost/fusion/container/generation/ignore.hpp b/include/boost/fusion/container/generation/ignore.hpp index 0bebade4..15ce15d4 100644 --- a/include/boost/fusion/container/generation/ignore.hpp +++ b/include/boost/fusion/container/generation/ignore.hpp @@ -17,7 +17,7 @@ namespace boost { namespace fusion struct swallow_assign { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED swallow_assign const& operator=(const T&) const { @@ -27,7 +27,7 @@ namespace boost { namespace fusion } // "ignore" allows tuple positions to be ignored when using "tie". - detail::swallow_assign const ignore = detail::swallow_assign(); + BOOST_CONSTEXPR detail::swallow_assign const ignore = detail::swallow_assign(); }} #endif diff --git a/include/boost/fusion/container/generation/list_tie.hpp b/include/boost/fusion/container/generation/list_tie.hpp index 2fa8c659..1dccb515 100644 --- a/include/boost/fusion/container/generation/list_tie.hpp +++ b/include/boost/fusion/container/generation/list_tie.hpp @@ -89,7 +89,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline list list_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & arg)) { diff --git a/include/boost/fusion/container/generation/make_cons.hpp b/include/boost/fusion/container/generation/make_cons.hpp index bb844ea3..616f1105 100644 --- a/include/boost/fusion/container/generation/make_cons.hpp +++ b/include/boost/fusion/container/generation/make_cons.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline cons::type> make_cons(Car const& car) { @@ -34,7 +34,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline cons::type, Cdr> make_cons(Car const& car, Cdr const& cdr) { diff --git a/include/boost/fusion/container/generation/make_deque.hpp b/include/boost/fusion/container/generation/make_deque.hpp index 18e41304..cb802f9a 100644 --- a/include/boost/fusion/container/generation/make_deque.hpp +++ b/include/boost/fusion/container/generation/make_deque.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline deque::type...> make_deque(T const&... arg) { diff --git a/include/boost/fusion/container/generation/make_list.hpp b/include/boost/fusion/container/generation/make_list.hpp index 8a9480e0..8cfc7e62 100644 --- a/include/boost/fusion/container/generation/make_list.hpp +++ b/include/boost/fusion/container/generation/make_list.hpp @@ -56,7 +56,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline list<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline list<> make_list() { return list<>(); @@ -101,7 +102,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline list make_list(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& arg)) { diff --git a/include/boost/fusion/container/generation/make_map.hpp b/include/boost/fusion/container/generation/make_map.hpp index d2eb16e2..a6538f81 100644 --- a/include/boost/fusion/container/generation/make_map.hpp +++ b/include/boost/fusion/container/generation/make_map.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline map< fusion::pair< Key diff --git a/include/boost/fusion/container/generation/make_set.hpp b/include/boost/fusion/container/generation/make_set.hpp index 5530ec59..0bde4a9c 100644 --- a/include/boost/fusion/container/generation/make_set.hpp +++ b/include/boost/fusion/container/generation/make_set.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) #pragma wave option(preserve: 1) +#define FUSION_HASH # #endif namespace boost { namespace fusion @@ -57,7 +59,22 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline set<> + // XXX: +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH else + BOOST_CONSTEXPR +FUSION_HASH endif +#else +#if defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#else + BOOST_CONSTEXPR +#endif +#endif + BOOST_FUSION_GPU_ENABLED + inline set<> make_set() { return set<>(); @@ -76,6 +93,7 @@ namespace boost { namespace fusion }} #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +#undef FUSION_HASH #pragma wave option(output: null) #endif @@ -103,7 +121,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline set make_set(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& arg)) { diff --git a/include/boost/fusion/container/generation/make_vector.hpp b/include/boost/fusion/container/generation/make_vector.hpp index ed089869..57cd9b10 100644 --- a/include/boost/fusion/container/generation/make_vector.hpp +++ b/include/boost/fusion/container/generation/make_vector.hpp @@ -56,7 +56,8 @@ namespace boost { namespace fusion }; } - BOOST_FUSION_GPU_ENABLED inline vector0<> + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline vector0<> make_vector() { return vector0<>(); @@ -101,7 +102,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline BOOST_PP_CAT(vector, N) make_vector(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& arg)) { diff --git a/include/boost/fusion/container/generation/map_tie.hpp b/include/boost/fusion/container/generation/map_tie.hpp index 4a988d42..259eee5f 100644 --- a/include/boost/fusion/container/generation/map_tie.hpp +++ b/include/boost/fusion/container/generation/map_tie.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline map...> map_tie(T&... arg) { diff --git a/include/boost/fusion/container/generation/pair_tie.hpp b/include/boost/fusion/container/generation/pair_tie.hpp index b4fbc780..2ba128f5 100644 --- a/include/boost/fusion/container/generation/pair_tie.hpp +++ b/include/boost/fusion/container/generation/pair_tie.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename disable_if, typename result_of::pair_tie::type>::type pair_tie(T& t) { @@ -35,7 +35,7 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result_of::pair_tie::type pair_tie(T const& t) { diff --git a/include/boost/fusion/container/generation/vector_tie.hpp b/include/boost/fusion/container/generation/vector_tie.hpp index 4c62edc8..28efa3bd 100644 --- a/include/boost/fusion/container/generation/vector_tie.hpp +++ b/include/boost/fusion/container/generation/vector_tie.hpp @@ -87,7 +87,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline vector vector_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & arg)) { diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp index 575e4d9e..61d8dbcf 100644 --- a/include/boost/fusion/container/list/cons.hpp +++ b/include/boost/fusion/container/list/cons.hpp @@ -49,31 +49,31 @@ namespace boost { namespace fusion typedef Car car_type; typedef Cdr cdr_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons() : car(), cdr() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit cons(typename detail::call_param::type in_car) : car(in_car), cdr() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons( typename detail::call_param::type in_car , typename detail::call_param::type in_cdr) : car(in_car), cdr(in_cdr) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons(cons const& rhs) : car(rhs.car), cdr(rhs.cdr) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons(cons const& rhs) : car(rhs.car), cdr(rhs.cdr) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons( Sequence const& seq , typename boost::enable_if< @@ -86,13 +86,13 @@ namespace boost { namespace fusion , cdr(fusion::next(fusion::begin(seq)), mpl::true_()) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons(Iterator const& iter, mpl::true_ /*this_is_an_iterator*/) : car(*iter) , cdr(fusion::next(iter), mpl::true_()) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons& operator=(cons const& rhs) { car = rhs.car; @@ -100,7 +100,7 @@ namespace boost { namespace fusion return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED cons& operator=(cons const& rhs) { car = rhs.car; @@ -109,7 +109,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename boost::enable_if< mpl::and_< traits::is_sequence @@ -124,7 +124,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void assign_from_iter(Iterator const& iter) { car = *iter; diff --git a/include/boost/fusion/container/list/cons_iterator.hpp b/include/boost/fusion/container/list/cons_iterator.hpp index da694756..1308d987 100644 --- a/include/boost/fusion/container/list/cons_iterator.hpp +++ b/include/boost/fusion/container/list/cons_iterator.hpp @@ -36,8 +36,8 @@ namespace boost { namespace fusion typename add_const::type> identity; - BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(cons_type& in_cons) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit cons_iterator(cons_type& in_cons) BOOST_NOEXCEPT : cons(in_cons) {} cons_type& cons; @@ -55,46 +55,47 @@ namespace boost { namespace fusion typedef cons_iterator_identity< add_const::type> identity; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - nil_iterator() {} + nil_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit nil_iterator(nil_ const&) {} + explicit nil_iterator(nil_ const&) BOOST_NOEXCEPT {} }; template <> struct cons_iterator : nil_iterator { BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - cons_iterator() {} + cons_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(nil_ const&) {} + explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {} }; template <> struct cons_iterator : nil_iterator { BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - cons_iterator() {} + cons_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(nil_ const&) {} + explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {} }; template <> struct cons_iterator > : nil_iterator { BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - cons_iterator() {} + cons_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(nil_ const&) {} + explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {} }; template <> struct cons_iterator const> : nil_iterator { BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - cons_iterator() {} + cons_iterator() BOOST_NOEXCEPT {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit cons_iterator(nil_ const&) {} + explicit cons_iterator(nil_ const&) BOOST_NOEXCEPT {} }; }} diff --git a/include/boost/fusion/container/list/convert.hpp b/include/boost/fusion/container/list/convert.hpp index f34ad396..d85fafeb 100644 --- a/include/boost/fusion/container/list/convert.hpp +++ b/include/boost/fusion/container/list/convert.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typedef typename build_cons::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_list::type as_list(Sequence& seq) { @@ -49,7 +49,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_list::type as_list(Sequence const& seq) { diff --git a/include/boost/fusion/container/list/detail/at_impl.hpp b/include/boost/fusion/container/list/detail/at_impl.hpp index b7688522..ab36665c 100644 --- a/include/boost/fusion/container/list/detail/at_impl.hpp +++ b/include/boost/fusion/container/list/detail/at_impl.hpp @@ -107,7 +107,7 @@ namespace boost { namespace fusion type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Cons& s, mpl::int_) { @@ -115,14 +115,14 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Cons& s, mpl::int_<0>) { return s.car; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/container/list/detail/begin_impl.hpp b/include/boost/fusion/container/list/detail/begin_impl.hpp index a3022345..088b382d 100644 --- a/include/boost/fusion/container/list/detail/begin_impl.hpp +++ b/include/boost/fusion/container/list/detail/begin_impl.hpp @@ -36,8 +36,8 @@ namespace boost { namespace fusion struct apply { typedef cons_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& t) { diff --git a/include/boost/fusion/container/list/detail/build_cons.hpp b/include/boost/fusion/container/list/detail/build_cons.hpp index 0f407008..206af1f1 100644 --- a/include/boost/fusion/container/list/detail/build_cons.hpp +++ b/include/boost/fusion/container/list/detail/build_cons.hpp @@ -26,8 +26,8 @@ namespace boost { namespace fusion { namespace detail struct build_cons { typedef nil_ type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static nil_ call(First const&, Last const&) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion { namespace detail template struct build_cons { - typedef + typedef build_cons::type, Last> next_build_cons; @@ -47,7 +47,7 @@ namespace boost { namespace fusion { namespace detail , typename next_build_cons::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& f, Last const& l) { diff --git a/include/boost/fusion/container/list/detail/convert_impl.hpp b/include/boost/fusion/container/list/detail/convert_impl.hpp index 000280e7..ff010186 100644 --- a/include/boost/fusion/container/list/detail/convert_impl.hpp +++ b/include/boost/fusion/container/list/detail/convert_impl.hpp @@ -39,7 +39,7 @@ namespace boost { namespace fusion typedef typename build_cons::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/container/list/detail/deref_impl.hpp b/include/boost/fusion/container/list/detail/deref_impl.hpp index aefffd75..3358a2a2 100644 --- a/include/boost/fusion/container/list/detail/deref_impl.hpp +++ b/include/boost/fusion/container/list/detail/deref_impl.hpp @@ -27,18 +27,18 @@ namespace boost { namespace fusion struct deref_impl { template - struct apply + struct apply { typedef typename Iterator::cons_type cons_type; typedef typename cons_type::car_type value_type; - + typedef typename mpl::eval_if< is_const , add_reference::type> , add_reference >::type type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/list/detail/end_impl.hpp b/include/boost/fusion/container/list/detail/end_impl.hpp index 9220d24a..6ed05a5f 100644 --- a/include/boost/fusion/container/list/detail/end_impl.hpp +++ b/include/boost/fusion/container/list/detail/end_impl.hpp @@ -33,13 +33,13 @@ namespace boost { namespace fusion struct end_impl { template - struct apply + struct apply { typedef cons_iterator< typename mpl::if_, nil_ const, nil_>::type> type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence&) { diff --git a/include/boost/fusion/container/list/detail/equal_to_impl.hpp b/include/boost/fusion/container/list/detail/equal_to_impl.hpp index 0cbb6bef..a0fc297f 100644 --- a/include/boost/fusion/container/list/detail/equal_to_impl.hpp +++ b/include/boost/fusion/container/list/detail/equal_to_impl.hpp @@ -25,7 +25,7 @@ namespace boost { namespace fusion struct equal_to_impl { template - struct apply + struct apply : is_same< typename I1::identity , typename I2::identity diff --git a/include/boost/fusion/container/list/detail/list_forward_ctor.hpp b/include/boost/fusion/container/list/detail/list_forward_ctor.hpp index fe652ae6..a5c8aa66 100644 --- a/include/boost/fusion/container/list/detail/list_forward_ctor.hpp +++ b/include/boost/fusion/container/list/detail/list_forward_ctor.hpp @@ -34,7 +34,7 @@ /////////////////////////////////////////////////////////////////////////////// #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED #if N == 1 explicit #endif diff --git a/include/boost/fusion/container/list/detail/list_to_cons_call.hpp b/include/boost/fusion/container/list/detail/list_to_cons_call.hpp index 3135382f..fbae5800 100644 --- a/include/boost/fusion/container/list/detail/list_to_cons_call.hpp +++ b/include/boost/fusion/container/list/detail/list_to_cons_call.hpp @@ -26,7 +26,7 @@ /////////////////////////////////////////////////////////////////////////////// #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(BOOST_PP_ENUM_BINARY_PARAMS( N, typename detail::call_param::type arg)) diff --git a/include/boost/fusion/container/list/detail/next_impl.hpp b/include/boost/fusion/container/list/detail/next_impl.hpp index 7383a963..f766458b 100644 --- a/include/boost/fusion/container/list/detail/next_impl.hpp +++ b/include/boost/fusion/container/list/detail/next_impl.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion { typedef typename Iterator::cons_type cons_type; typedef typename cons_type::cdr_type cdr_type; - + typedef cons_iterator< typename mpl::eval_if< is_const @@ -44,8 +44,8 @@ namespace boost { namespace fusion , mpl::identity >::type> type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/list/detail/reverse_cons.hpp b/include/boost/fusion/container/list/detail/reverse_cons.hpp index f80e2c2d..14905180 100644 --- a/include/boost/fusion/container/list/detail/reverse_cons.hpp +++ b/include/boost/fusion/container/list/detail/reverse_cons.hpp @@ -22,7 +22,7 @@ namespace boost { namespace fusion { namespace detail typedef reverse_cons > impl; typedef typename impl::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(cons const &cons, State const &state = State()) { typedef fusion::cons cdr_type; @@ -35,7 +35,7 @@ namespace boost { namespace fusion { namespace detail { typedef State type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static State const &call(nil_ const &, State const &state = State()) { return state; diff --git a/include/boost/fusion/container/list/detail/value_at_impl.hpp b/include/boost/fusion/container/list/detail/value_at_impl.hpp index ea9a8593..8b288a12 100644 --- a/include/boost/fusion/container/list/detail/value_at_impl.hpp +++ b/include/boost/fusion/container/list/detail/value_at_impl.hpp @@ -26,9 +26,9 @@ namespace boost { namespace fusion struct value_at_impl { template - struct apply + struct apply { - typedef typename + typedef typename mpl::eval_if< mpl::bool_ , mpl::identity diff --git a/include/boost/fusion/container/list/detail/value_of_impl.hpp b/include/boost/fusion/container/list/detail/value_of_impl.hpp index daabe411..9e7aa208 100644 --- a/include/boost/fusion/container/list/detail/value_of_impl.hpp +++ b/include/boost/fusion/container/list/detail/value_of_impl.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion struct value_of_impl { template - struct apply + struct apply { typedef typename Iterator::cons_type cons_type; typedef typename cons_type::car_type type; diff --git a/include/boost/fusion/container/list/list.hpp b/include/boost/fusion/container/list/list.hpp index 7f71856d..5b584131 100644 --- a/include/boost/fusion/container/list/list.hpp +++ b/include/boost/fusion/container/list/list.hpp @@ -50,17 +50,17 @@ namespace boost { namespace fusion public: typedef typename list_to_cons::type inherited_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED list() : inherited_type() {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED list(list const& rhs) : inherited_type(rhs) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs , typename boost::enable_if >::type* = 0) : inherited_type(rhs) {} @@ -75,7 +75,7 @@ namespace boost { namespace fusion #include template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED list& operator=(list const& rhs) { @@ -84,7 +84,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename boost::enable_if, list&>::type operator=(Sequence const& rhs) { diff --git a/include/boost/fusion/container/list/nil.hpp b/include/boost/fusion/container/list/nil.hpp index ef909c97..1b2c2349 100644 --- a/include/boost/fusion/container/list/nil.hpp +++ b/include/boost/fusion/container/list/nil.hpp @@ -32,16 +32,16 @@ namespace boost { namespace fusion typedef void_ cdr_type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - nil_() {} + nil_() BOOST_NOEXCEPT {} template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - nil_(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/) + nil_(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/) BOOST_NOEXCEPT {} template - BOOST_FUSION_GPU_ENABLED - void assign_from_iter(Iterator const& /*iter*/) + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + void assign_from_iter(Iterator const& /*iter*/) BOOST_NOEXCEPT { } }; diff --git a/include/boost/fusion/container/map/convert.hpp b/include/boost/fusion/container/map/convert.hpp index d106610b..10431c84 100644 --- a/include/boost/fusion/container/map/convert.hpp +++ b/include/boost/fusion/container/map/convert.hpp @@ -17,7 +17,7 @@ namespace boost { namespace fusion { namespace detail { typedef typename result_of::value_of::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(It const& it) { return *it; @@ -31,7 +31,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::value_of_data::type data_type; typedef typename fusion::pair type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(It const& it) { return type(deref_data(it)); @@ -69,7 +69,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence& seq) { @@ -78,7 +78,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence const& seq) { @@ -101,7 +101,7 @@ namespace boost { namespace fusion result_of::as_map::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { typedef result_of::as_map gen; diff --git a/include/boost/fusion/container/map/detail/at_impl.hpp b/include/boost/fusion/container/map/detail/at_impl.hpp index ce9d7a63..ab35870f 100644 --- a/include/boost/fusion/container/map/detail/at_impl.hpp +++ b/include/boost/fusion/container/map/detail/at_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(index())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& m) { @@ -47,7 +47,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(index())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& m) { diff --git a/include/boost/fusion/container/map/detail/at_key_impl.hpp b/include/boost/fusion/container/map/detail/at_key_impl.hpp index 81ca6156..a546bd00 100644 --- a/include/boost/fusion/container/map/detail/at_key_impl.hpp +++ b/include/boost/fusion/container/map/detail/at_key_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(mpl::identity())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& m) { @@ -48,7 +48,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(mpl::identity())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& m) { diff --git a/include/boost/fusion/container/map/detail/begin_impl.hpp b/include/boost/fusion/container/map/detail/begin_impl.hpp index 9c8f4acb..65b39d1f 100644 --- a/include/boost/fusion/container/map/detail/begin_impl.hpp +++ b/include/boost/fusion/container/map/detail/begin_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef map_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return type(seq); diff --git a/include/boost/fusion/container/map/detail/build_map.hpp b/include/boost/fusion/container/map/detail/build_map.hpp index f5a6875f..d8f3f33f 100644 --- a/include/boost/fusion/container/map/detail/build_map.hpp +++ b/include/boost/fusion/container/map/detail/build_map.hpp @@ -28,7 +28,7 @@ namespace boost { namespace fusion { namespace detail struct build_map { typedef map<> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const&, Last const&) { @@ -44,7 +44,7 @@ namespace boost { namespace fusion { namespace detail { typedef map type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(T const& first, map const& rest) { @@ -66,7 +66,7 @@ namespace boost { namespace fusion { namespace detail typedef typename push_front::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& f, Last const& l) { diff --git a/include/boost/fusion/container/map/detail/cpp03/as_map.hpp b/include/boost/fusion/container/map/detail/cpp03/as_map.hpp index 4af79522..efa836ba 100644 --- a/include/boost/fusion/container/map/detail/cpp03/as_map.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/as_map.hpp @@ -37,7 +37,7 @@ BOOST_FUSION_BARRIER_BEGIN }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator) { @@ -127,7 +127,7 @@ BOOST_FUSION_BARRIER_END }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator const& i0) { diff --git a/include/boost/fusion/container/map/detail/cpp03/at_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/at_impl.hpp index 8a3209d7..b1044d7d 100644 --- a/include/boost/fusion/container/map/detail/cpp03/at_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/at_impl.hpp @@ -27,14 +27,14 @@ namespace boost { namespace fusion struct at_impl { template - struct apply + struct apply { - typedef typename - mpl::at::type + typedef typename + mpl::at::type element; typedef typename detail::ref_result::type type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& m) { @@ -45,12 +45,12 @@ namespace boost { namespace fusion template struct apply { - typedef typename - mpl::at::type + typedef typename + mpl::at::type element; typedef typename detail::cref_result::type type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& m) { diff --git a/include/boost/fusion/container/map/detail/cpp03/begin_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/begin_impl.hpp index 5fe1466e..6255ed88 100644 --- a/include/boost/fusion/container/map/detail/cpp03/begin_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/begin_impl.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/container/map/detail/cpp03/convert.hpp b/include/boost/fusion/container/map/detail/cpp03/convert.hpp index a03840ce..c5cc3bd6 100644 --- a/include/boost/fusion/container/map/detail/cpp03/convert.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/convert.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence& seq) { @@ -45,7 +45,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_map::type as_map(Sequence const& seq) { diff --git a/include/boost/fusion/container/map/detail/cpp03/convert_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/convert_impl.hpp index 14a821e8..3a773d74 100644 --- a/include/boost/fusion/container/map/detail/cpp03/convert_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/convert_impl.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion template apply::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return gen::call(fusion::begin(seq)); diff --git a/include/boost/fusion/container/map/detail/cpp03/deref_data_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/deref_data_impl.hpp index 7be6fd96..ccaa2910 100644 --- a/include/boost/fusion/container/map/detail/cpp03/deref_data_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/deref_data_impl.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion { namespace extension >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/container/map/detail/cpp03/deref_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/deref_impl.hpp index 260c5dfd..7fa01c3f 100644 --- a/include/boost/fusion/container/map/detail/cpp03/deref_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/deref_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion { namespace extension >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/container/map/detail/cpp03/end_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/end_impl.hpp index 33940c7a..2830b955 100644 --- a/include/boost/fusion/container/map/detail/cpp03/end_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/end_impl.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/container/map/detail/cpp03/map.hpp b/include/boost/fusion/container/map/detail/cpp03/map.hpp index 8673895e..25178fe8 100644 --- a/include/boost/fusion/container/map/detail/cpp03/map.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/map.hpp @@ -65,35 +65,35 @@ namespace boost { namespace fusion typedef typename storage_type::size size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map() : data() {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(Sequence const& rhs) : data(rhs) {} #include template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(T const& rhs) { data = rhs; return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(map const& rhs) { data = rhs.data; return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED storage_type& get_data() { return data; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED storage_type const& get_data() const { return data; } private: diff --git a/include/boost/fusion/container/map/detail/cpp03/map_forward_ctor.hpp b/include/boost/fusion/container/map/detail/cpp03/map_forward_ctor.hpp index 3938f9a4..8cf9fa48 100644 --- a/include/boost/fusion/container/map/detail/cpp03/map_forward_ctor.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/map_forward_ctor.hpp @@ -27,7 +27,7 @@ #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED #if N == 1 explicit #endif diff --git a/include/boost/fusion/container/map/detail/cpp03/value_at_impl.hpp b/include/boost/fusion/container/map/detail/cpp03/value_at_impl.hpp index d61ab203..2af55396 100644 --- a/include/boost/fusion/container/map/detail/cpp03/value_at_impl.hpp +++ b/include/boost/fusion/container/map/detail/cpp03/value_at_impl.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion struct value_at_impl { template - struct apply + struct apply { typedef typename mpl::at::type type; }; diff --git a/include/boost/fusion/container/map/detail/end_impl.hpp b/include/boost/fusion/container/map/detail/end_impl.hpp index fea45db3..50dec8ef 100644 --- a/include/boost/fusion/container/map/detail/end_impl.hpp +++ b/include/boost/fusion/container/map/detail/end_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef map_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return type(seq); diff --git a/include/boost/fusion/container/map/detail/map_impl.hpp b/include/boost/fusion/container/map/detail/map_impl.hpp index 4b4baadb..c62145ba 100644 --- a/include/boost/fusion/container/map/detail/map_impl.hpp +++ b/include/boost/fusion/container/map/detail/map_impl.hpp @@ -33,24 +33,24 @@ namespace boost { namespace fusion { namespace detail static int const index = index_; static int const size = 0; - BOOST_FUSION_GPU_ENABLED - map_impl() {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + map_impl() BOOST_NOEXCEPT {} template - BOOST_FUSION_GPU_ENABLED - map_impl(Iterator const&, map_impl_from_iterator) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + map_impl(Iterator const&, map_impl_from_iterator) BOOST_NOEXCEPT {} template - BOOST_FUSION_GPU_ENABLED - void assign(Iterator const&, map_impl_from_iterator) + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + void assign(Iterator const&, map_impl_from_iterator) BOOST_NOEXCEPT {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void get(); - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void get_val(); - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void get_key(); }; @@ -71,54 +71,54 @@ namespace boost { namespace fusion { namespace detail typedef typename Pair::first_type key_type; typedef typename Pair::second_type value_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl() : rest_type(), element() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(map_impl const& rhs) : rest_type(rhs.get_base()), element(rhs.element) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(map_impl&& rhs) : rest_type(BOOST_FUSION_FWD_ELEM(rest_type, *static_cast(&rhs))) , element(BOOST_FUSION_FWD_ELEM(Pair, rhs.element)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(map_impl const& rhs) : rest_type(rhs.get_base()), element(rhs.element) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(typename detail::call_param::type element_ , typename detail::call_param::type... rest) : rest_type(rest...), element(element_) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(Pair&& element_, T&&... rest) : rest_type(BOOST_FUSION_FWD_ELEM(T, rest)...) , element(BOOST_FUSION_FWD_ELEM(Pair, element_)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl(Iterator const& iter, map_impl_from_iterator fi) : rest_type(fusion::next(iter), fi) , element(*iter) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED rest_type& get_base() { return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED rest_type const& get_base() const { return *this; @@ -138,28 +138,28 @@ namespace boost { namespace fusion { namespace detail BOOST_FUSION_GPU_ENABLED mpl::identity get_key(mpl::int_) const; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename cref_result::type get(mpl::identity) const { return element.second; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename ref_result::type get(mpl::identity) { return element.second; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename cref_result::type get(mpl::int_) const { return element; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename ref_result::type get(mpl::int_) { @@ -167,7 +167,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl& operator=(map_impl const& rhs) { rest_type::operator=(rhs); @@ -175,7 +175,7 @@ namespace boost { namespace fusion { namespace detail return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl& operator=(map_impl const& rhs) { rest_type::operator=(rhs); @@ -183,7 +183,7 @@ namespace boost { namespace fusion { namespace detail return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_impl& operator=(map_impl&& rhs) { rest_type::operator=(std::forward(rhs)); @@ -192,7 +192,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED void assign(Iterator const& iter, map_impl_from_iterator fi) { rest_type::assign(fusion::next(iter), fi); diff --git a/include/boost/fusion/container/map/map.hpp b/include/boost/fusion/container/map/map.hpp index 1d308e96..f93a693f 100644 --- a/include/boost/fusion/container/map/map.hpp +++ b/include/boost/fusion/container/map/map.hpp @@ -52,60 +52,60 @@ namespace boost { namespace fusion typedef mpl::int_ size; typedef mpl::false_ is_view; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(map const& seq) : base_type(seq.base()) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(map&& seq) : base_type(std::forward(seq)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR 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_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(Sequence& seq , typename enable_if>::type* /*dummy*/ = 0) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(Sequence&& seq , typename enable_if>::type* /*dummy*/ = 0) : base_type(begin(seq), detail::map_impl_from_iterator()) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(First const& first, T_ const&... rest) : base_type(first, rest...) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map(First&& first, T_&&... rest) : base_type(BOOST_FUSION_FWD_ELEM(First, first), BOOST_FUSION_FWD_ELEM(T_, rest)...) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(map const& rhs) { base_type::operator=(rhs.base()); return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED map& operator=(map&& rhs) { base_type::operator=(std::forward(rhs.base())); @@ -113,7 +113,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename enable_if, map&>::type operator=(Sequence const& seq) { @@ -121,10 +121,10 @@ namespace boost { namespace fusion return *this; } - BOOST_FUSION_GPU_ENABLED - base_type& base() { return *this; } - BOOST_FUSION_GPU_ENABLED - base_type const& base() const { return *this; } + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + base_type& base() BOOST_NOEXCEPT { return *this; } + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + base_type const& base() const BOOST_NOEXCEPT { return *this; } }; }} diff --git a/include/boost/fusion/container/map/map_iterator.hpp b/include/boost/fusion/container/map/map_iterator.hpp index 4927e155..99f8add0 100644 --- a/include/boost/fusion/container/map/map_iterator.hpp +++ b/include/boost/fusion/container/map/map_iterator.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion typedef Seq sequence; typedef mpl::int_ index; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED map_iterator(Seq& seq) : seq_(seq) {} @@ -73,7 +73,7 @@ namespace boost { namespace fusion decltype(boost::declval().get(index())) type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { @@ -99,7 +99,7 @@ namespace boost { namespace fusion typedef typename add_reference::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { @@ -114,7 +114,7 @@ namespace boost { namespace fusion typedef typename Iterator::sequence sequence; typedef map_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -141,7 +141,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(I1 const&, I2 const&) { diff --git a/include/boost/fusion/container/set/convert.hpp b/include/boost/fusion/container/set/convert.hpp index 631c251d..81e064cd 100644 --- a/include/boost/fusion/container/set/convert.hpp +++ b/include/boost/fusion/container/set/convert.hpp @@ -29,7 +29,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_set::type as_set(Sequence& seq) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_set::type as_set(Sequence const& seq) { diff --git a/include/boost/fusion/container/set/detail/as_set.hpp b/include/boost/fusion/container/set/detail/as_set.hpp index a1e8cb7b..a41498a3 100644 --- a/include/boost/fusion/container/set/detail/as_set.hpp +++ b/include/boost/fusion/container/set/detail/as_set.hpp @@ -37,7 +37,7 @@ BOOST_FUSION_BARRIER_BEGIN }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator) { @@ -123,7 +123,7 @@ BOOST_FUSION_BARRIER_END }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator const& i0) { diff --git a/include/boost/fusion/container/set/detail/begin_impl.hpp b/include/boost/fusion/container/set/detail/begin_impl.hpp index df522b57..1ebd4e46 100644 --- a/include/boost/fusion/container/set/detail/begin_impl.hpp +++ b/include/boost/fusion/container/set/detail/begin_impl.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/container/set/detail/convert_impl.hpp b/include/boost/fusion/container/set/detail/convert_impl.hpp index 4a24dff8..d9d5dcfc 100644 --- a/include/boost/fusion/container/set/detail/convert_impl.hpp +++ b/include/boost/fusion/container/set/detail/convert_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion template apply::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return gen::call(fusion::begin(seq)); diff --git a/include/boost/fusion/container/set/detail/deref_impl.hpp b/include/boost/fusion/container/set/detail/deref_impl.hpp index 4a43819d..e5da5219 100644 --- a/include/boost/fusion/container/set/detail/deref_impl.hpp +++ b/include/boost/fusion/container/set/detail/deref_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion { namespace extension >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/container/set/detail/end_impl.hpp b/include/boost/fusion/container/set/detail/end_impl.hpp index b793addc..fbae9b75 100644 --- a/include/boost/fusion/container/set/detail/end_impl.hpp +++ b/include/boost/fusion/container/set/detail/end_impl.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace extension > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/container/set/detail/set_forward_ctor.hpp b/include/boost/fusion/container/set/detail/set_forward_ctor.hpp index 460de434..5d396104 100644 --- a/include/boost/fusion/container/set/detail/set_forward_ctor.hpp +++ b/include/boost/fusion/container/set/detail/set_forward_ctor.hpp @@ -27,7 +27,7 @@ #define N BOOST_PP_ITERATION() - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED #if N == 1 explicit #endif diff --git a/include/boost/fusion/container/set/set.hpp b/include/boost/fusion/container/set/set.hpp index 3d7bdfce..65a080b0 100644 --- a/include/boost/fusion/container/set/set.hpp +++ b/include/boost/fusion/container/set/set.hpp @@ -65,12 +65,12 @@ namespace boost { namespace fusion typedef typename storage_type::size size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set() : data() {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED set(Sequence const& rhs , typename boost::enable_if >::type* = 0) : data(rhs) {} @@ -78,7 +78,7 @@ namespace boost { namespace fusion #include template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED set& operator=(T const& rhs) { @@ -86,9 +86,9 @@ namespace boost { namespace fusion return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED storage_type& get_data() { return data; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED storage_type const& get_data() const { return data; } private: diff --git a/include/boost/fusion/container/vector/convert.hpp b/include/boost/fusion/container/vector/convert.hpp index 0582fe5c..adc7f478 100644 --- a/include/boost/fusion/container/vector/convert.hpp +++ b/include/boost/fusion/container/vector/convert.hpp @@ -29,7 +29,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_vector::type as_vector(Sequence& seq) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::as_vector::type as_vector(Sequence const& seq) { diff --git a/include/boost/fusion/container/vector/detail/advance_impl.hpp b/include/boost/fusion/container/vector/detail/advance_impl.hpp index af45a1a8..3bf26a59 100644 --- a/include/boost/fusion/container/vector/detail/advance_impl.hpp +++ b/include/boost/fusion/container/vector/detail/advance_impl.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion { template struct advance_impl; - + template <> struct advance_impl { @@ -28,8 +28,8 @@ namespace boost { namespace fusion typedef typename Iterator::index index; typedef typename Iterator::vector vector; typedef vector_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/vector/detail/as_vector.hpp b/include/boost/fusion/container/vector/detail/as_vector.hpp index 368557d0..b5f5e2d0 100644 --- a/include/boost/fusion/container/vector/detail/as_vector.hpp +++ b/include/boost/fusion/container/vector/detail/as_vector.hpp @@ -37,7 +37,7 @@ BOOST_FUSION_BARRIER_BEGIN }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator) { @@ -123,7 +123,7 @@ BOOST_FUSION_BARRIER_END }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename apply::type call(Iterator const& i0) { diff --git a/include/boost/fusion/container/vector/detail/at_impl.hpp b/include/boost/fusion/container/vector/detail/at_impl.hpp index eb09b212..cb98dd4a 100644 --- a/include/boost/fusion/container/vector/detail/at_impl.hpp +++ b/include/boost/fusion/container/vector/detail/at_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typedef typename mpl::at::type element; typedef typename detail::ref_result::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { @@ -46,7 +46,7 @@ namespace boost { namespace fusion typedef typename mpl::at::type element; typedef typename detail::cref_result::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& v) { diff --git a/include/boost/fusion/container/vector/detail/begin_impl.hpp b/include/boost/fusion/container/vector/detail/begin_impl.hpp index 026b34ff..ef24cd74 100644 --- a/include/boost/fusion/container/vector/detail/begin_impl.hpp +++ b/include/boost/fusion/container/vector/detail/begin_impl.hpp @@ -23,11 +23,11 @@ namespace boost { namespace fusion struct begin_impl { template - struct apply + struct apply { typedef vector_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/container/vector/detail/convert_impl.hpp b/include/boost/fusion/container/vector/detail/convert_impl.hpp index ddf42590..63bfb7c7 100644 --- a/include/boost/fusion/container/vector/detail/convert_impl.hpp +++ b/include/boost/fusion/container/vector/detail/convert_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion template apply::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { return gen::call(fusion::begin(seq)); diff --git a/include/boost/fusion/container/vector/detail/deref_impl.hpp b/include/boost/fusion/container/vector/detail/deref_impl.hpp index b338d2fe..5186aa10 100644 --- a/include/boost/fusion/container/vector/detail/deref_impl.hpp +++ b/include/boost/fusion/container/vector/detail/deref_impl.hpp @@ -26,14 +26,14 @@ namespace boost { namespace fusion struct deref_impl { template - struct apply + struct apply { typedef typename Iterator::vector vector; typedef typename Iterator::index index; typedef typename mpl::at< typename vector::types, index>::type element; - + typedef typename mpl::if_< is_const @@ -42,7 +42,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/vector/detail/distance_impl.hpp b/include/boost/fusion/container/vector/detail/distance_impl.hpp index 94835538..4c2a1226 100644 --- a/include/boost/fusion/container/vector/detail/distance_impl.hpp +++ b/include/boost/fusion/container/vector/detail/distance_impl.hpp @@ -24,8 +24,8 @@ namespace boost { namespace fusion { template struct apply : mpl::minus - { - BOOST_FUSION_GPU_ENABLED + { + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename mpl::minus< typename Last::index, typename First::index>::type call(First const&, Last const&) diff --git a/include/boost/fusion/container/vector/detail/end_impl.hpp b/include/boost/fusion/container/vector/detail/end_impl.hpp index 14c67157..a77ef644 100644 --- a/include/boost/fusion/container/vector/detail/end_impl.hpp +++ b/include/boost/fusion/container/vector/detail/end_impl.hpp @@ -23,12 +23,12 @@ namespace boost { namespace fusion struct end_impl { template - struct apply + struct apply { typedef typename Sequence::size size; typedef vector_iterator type; - - BOOST_FUSION_GPU_ENABLED + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& v) { diff --git a/include/boost/fusion/container/vector/detail/equal_to_impl.hpp b/include/boost/fusion/container/vector/detail/equal_to_impl.hpp index 50420cc8..18b3e4a3 100644 --- a/include/boost/fusion/container/vector/detail/equal_to_impl.hpp +++ b/include/boost/fusion/container/vector/detail/equal_to_impl.hpp @@ -25,7 +25,7 @@ namespace boost { namespace fusion struct equal_to_impl { template - struct apply + struct apply : is_same< typename I1::identity , typename I2::identity diff --git a/include/boost/fusion/container/vector/detail/next_impl.hpp b/include/boost/fusion/container/vector/detail/next_impl.hpp index 78aef85d..28408205 100644 --- a/include/boost/fusion/container/vector/detail/next_impl.hpp +++ b/include/boost/fusion/container/vector/detail/next_impl.hpp @@ -25,13 +25,13 @@ namespace boost { namespace fusion struct next_impl { template - struct apply + struct apply { typedef typename Iterator::vector vector; typedef typename Iterator::index index; typedef vector_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/vector/detail/prior_impl.hpp b/include/boost/fusion/container/vector/detail/prior_impl.hpp index b3bdc55f..4d040d39 100644 --- a/include/boost/fusion/container/vector/detail/prior_impl.hpp +++ b/include/boost/fusion/container/vector/detail/prior_impl.hpp @@ -25,13 +25,13 @@ namespace boost { namespace fusion struct prior_impl { template - struct apply + struct apply { typedef typename Iterator::vector vector; typedef typename Iterator::index index; typedef vector_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/container/vector/detail/value_at_impl.hpp b/include/boost/fusion/container/vector/detail/value_at_impl.hpp index 9b94e9de..06402b43 100644 --- a/include/boost/fusion/container/vector/detail/value_at_impl.hpp +++ b/include/boost/fusion/container/vector/detail/value_at_impl.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion struct value_at_impl { template - struct apply + struct apply { typedef typename mpl::at::type type; }; diff --git a/include/boost/fusion/container/vector/detail/value_of_impl.hpp b/include/boost/fusion/container/vector/detail/value_of_impl.hpp index 7527d581..2a8acf91 100644 --- a/include/boost/fusion/container/vector/detail/value_of_impl.hpp +++ b/include/boost/fusion/container/vector/detail/value_of_impl.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion struct value_of_impl { template - struct apply + struct apply { typedef typename Iterator::vector vector; typedef typename Iterator::index index; diff --git a/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp b/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp index ff8aaccd..8ec63607 100644 --- a/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp +++ b/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp @@ -26,6 +26,16 @@ #define M BOOST_PP_ITERATION() + // 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 #if M == 1 explicit @@ -40,6 +50,16 @@ 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 + // XXX: +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED #if M == 1 explicit diff --git a/include/boost/fusion/container/vector/detail/vector_n.hpp b/include/boost/fusion/container/vector/detail/vector_n.hpp index b7a910aa..932ce36c 100644 --- a/include/boost/fusion/container/vector/detail/vector_n.hpp +++ b/include/boost/fusion/container/vector/detail/vector_n.hpp @@ -41,9 +41,11 @@ BOOST_PP_CAT(T, n)>(vec.BOOST_PP_CAT(m, n)); #define FUSION_VECTOR_MEMBER_AT_IMPL(z, n, _) \ - BOOST_FUSION_GPU_ENABLED typename add_reference::type \ + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ + typename add_reference::type \ at_impl(mpl::int_) { return this->m##n; } \ - BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ + typename add_reference::type>::type \ at_impl(mpl::int_) const { return this->m##n; } #define FUSION_VECTOR_MEMBER_ITER_DECL_VAR(z, n, _) \ @@ -59,7 +61,7 @@ template struct BOOST_PP_CAT(vector_data, N) { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)() : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_DEFAULT_INIT, _) {} @@ -69,11 +71,22 @@ 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 +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, U, && arg) , typename boost::enable_if >::type* /*dummy*/ = 0 ) : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_ARG_FWD, arg) {} + + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)( BOOST_PP_CAT(vector_data, N)&& other) : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_FORWARD, arg) {} @@ -82,18 +95,27 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) FUSION_HASH endif #endif +#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 BOOST_PP_CAT(vector_data, N)( BOOST_PP_ENUM_BINARY_PARAMS( N, typename detail::call_param::type arg)) : BOOST_PP_ENUM(N, FUSION_VECTOR_CTOR_INIT, arg) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)( BOOST_PP_CAT(vector_data, N) const& other) : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_CTOR_INIT, _) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector_data, N)& operator=(BOOST_PP_CAT(vector_data, N) const& vec) { @@ -102,6 +124,15 @@ FUSION_HASH endif } template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED static BOOST_PP_CAT(vector_data, N) init_from_sequence(Sequence const& seq) @@ -113,6 +144,15 @@ FUSION_HASH endif } template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED static BOOST_PP_CAT(vector_data, N) init_from_sequence(Sequence& seq) @@ -140,9 +180,18 @@ FUSION_HASH endif typedef random_access_traversal_tag category; typedef mpl::int_ size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)() {} +#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 #if (N == 1) explicit @@ -158,6 +207,15 @@ 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 +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED #if (N == 1) explicit @@ -170,15 +228,15 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) : base_type(BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_FORWARD, arg)) {} #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N)&& rhs) : base_type(std::forward(rhs)) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N) const& rhs) : base_type(static_cast(rhs)) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)& operator=(BOOST_PP_CAT(vector, N) const& vec) { @@ -186,7 +244,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)& operator=(BOOST_PP_CAT(vector, N)&& vec) { @@ -199,12 +257,30 @@ FUSION_HASH endif #endif template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( BOOST_PP_CAT(vector, N) const& vec) : base_type(BOOST_PP_ENUM_PARAMS(N, vec.m)) {} template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( Sequence const& seq @@ -216,6 +292,15 @@ FUSION_HASH endif : base_type(base_type::init_from_sequence(seq)) {} template +#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) +FUSION_HASH if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +FUSION_HASH endif +#else +#if !defined(BOOST_CLANG) + BOOST_CXX14_CONSTEXPR +#endif +#endif BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)( Sequence& seq @@ -227,7 +312,7 @@ FUSION_HASH endif : base_type(base_type::init_from_sequence(seq)) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_PP_CAT(vector, N)& operator=(BOOST_PP_CAT(vector, N) const& vec) { @@ -236,7 +321,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename boost::disable_if, this_type&>::type operator=(Sequence const& seq) { @@ -250,7 +335,7 @@ FUSION_HASH endif BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_AT_IMPL, _) template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type at_impl(I) { @@ -258,7 +343,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type>::type at_impl(I) const { diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 6728fa40..c1cea915 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -31,7 +31,7 @@ ctor_helper(rhs, is_base_of()) \ #define BOOST_FUSION_VECTOR_CTOR_HELPER() \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static vector_n const& \ ctor_helper(vector const& rhs, mpl::true_) \ { \ @@ -39,7 +39,7 @@ } \ \ template \ - BOOST_FUSION_GPU_ENABLED \ + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED \ static T const& \ ctor_helper(T const& rhs, mpl::false_) \ { \ @@ -102,20 +102,30 @@ namespace boost { namespace fusion typedef typename vector_n::category category; typedef typename vector_n::is_view is_view; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector() : vec() {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector(vector const& rhs) : vec(rhs.vec) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector(vector const& rhs) : 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) @@ -131,7 +141,7 @@ namespace boost { namespace fusion #include template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(vector const& rhs) { @@ -140,7 +150,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(T const& rhs) { @@ -148,7 +158,7 @@ namespace boost { namespace fusion return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(vector const& rhs) { @@ -161,10 +171,11 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) #endif #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ (defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector(vector&& rhs) : vec(std::forward(rhs.vec)) {} - BOOST_FUSION_GPU_ENABLED + + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(vector&& rhs) { @@ -173,7 +184,7 @@ FUSION_HASH if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector& operator=(T&& rhs) { @@ -186,7 +197,7 @@ FUSION_HASH endif #endif template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference< typename mpl::at_c::type >::type @@ -196,7 +207,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference< typename add_const< typename mpl::at_c::type @@ -208,7 +219,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference< typename mpl::at::type >::type @@ -218,7 +229,7 @@ FUSION_HASH endif } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference< typename add_const< typename mpl::at::type diff --git a/include/boost/fusion/container/vector/vector10.hpp b/include/boost/fusion/container/vector/vector10.hpp index 2e24f028..a5ef4754 100644 --- a/include/boost/fusion/container/vector/vector10.hpp +++ b/include/boost/fusion/container/vector/vector10.hpp @@ -52,12 +52,12 @@ namespace boost { namespace fusion typedef random_access_traversal_tag category; typedef mpl::int_<0> size; - BOOST_FUSION_GPU_ENABLED - vector0() {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + vector0() BOOST_NOEXCEPT {} template - BOOST_FUSION_GPU_ENABLED - vector0(Sequence const& /*seq*/) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + vector0(Sequence const& /*seq*/) BOOST_NOEXCEPT {} }; }} diff --git a/include/boost/fusion/container/vector/vector_iterator.hpp b/include/boost/fusion/container/vector/vector_iterator.hpp index ffa4d138..a53a8ca7 100644 --- a/include/boost/fusion/container/vector/vector_iterator.hpp +++ b/include/boost/fusion/container/vector/vector_iterator.hpp @@ -37,9 +37,10 @@ namespace boost { namespace fusion typedef vector_iterator_identity< typename add_const::type, N> identity; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED vector_iterator(Vector& in_vec) : vec(in_vec) {} + Vector& vec; private: diff --git a/include/boost/fusion/functional/adapter/fused.hpp b/include/boost/fusion/functional/adapter/fused.hpp index c6b1b03c..c27d0acc 100644 --- a/include/boost/fusion/functional/adapter/fused.hpp +++ b/include/boost/fusion/functional/adapter/fused.hpp @@ -37,13 +37,13 @@ namespace boost { namespace fusion public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit fused(func_const_fwd_t f = Function()) : fnc_transformed(f) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type operator()(Seq const & s) const { @@ -51,7 +51,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type operator()(Seq const & s) { @@ -59,7 +59,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type operator()(Seq & s) const { @@ -67,7 +67,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type operator()(Seq & s) { diff --git a/include/boost/fusion/functional/adapter/fused_function_object.hpp b/include/boost/fusion/functional/adapter/fused_function_object.hpp index b3973a11..cdb9c24b 100644 --- a/include/boost/fusion/functional/adapter/fused_function_object.hpp +++ b/include/boost/fusion/functional/adapter/fused_function_object.hpp @@ -37,13 +37,13 @@ namespace boost { namespace fusion public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit fused_function_object(func_const_fwd_t f = Function()) : fnc_transformed(f) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type operator()(Seq const & s) const { @@ -52,7 +52,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type operator()(Seq const & s) @@ -62,7 +62,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type operator()(Seq & s) const @@ -72,7 +72,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type operator()(Seq & s) { diff --git a/include/boost/fusion/functional/adapter/fused_procedure.hpp b/include/boost/fusion/functional/adapter/fused_procedure.hpp index 495320af..79be2176 100644 --- a/include/boost/fusion/functional/adapter/fused_procedure.hpp +++ b/include/boost/fusion/functional/adapter/fused_procedure.hpp @@ -37,13 +37,13 @@ namespace boost { namespace fusion public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit fused_procedure(func_const_fwd_t f = Function()) : fnc_transformed(f) { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void operator()(Seq const & s) const { fusion::invoke_procedure< @@ -51,7 +51,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void operator()(Seq const & s) { fusion::invoke_procedure< @@ -59,7 +59,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void operator()(Seq & s) const { fusion::invoke_procedure< @@ -67,7 +67,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void operator()(Seq & s) { return fusion::invoke_procedure< diff --git a/include/boost/fusion/functional/adapter/unfused.hpp b/include/boost/fusion/functional/adapter/unfused.hpp index b02f5d28..9d85869d 100644 --- a/include/boost/fusion/functional/adapter/unfused.hpp +++ b/include/boost/fusion/functional/adapter/unfused.hpp @@ -47,14 +47,16 @@ namespace boost { namespace fusion using unfused::operator(); - BOOST_FUSION_GPU_ENABLED inline explicit unfused(func_const_fwd_t f = function()) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline explicit unfused(func_const_fwd_t f = function()) : unfused(f) { } typedef typename boost::result_of< function_c(fusion::vector0<> &) >::type call_const_0_result; - BOOST_FUSION_GPU_ENABLED inline call_const_0_result operator()() const + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline call_const_0_result operator()() const { fusion::vector0<> arg; return this->fnc_transformed(arg); @@ -63,7 +65,8 @@ namespace boost { namespace fusion typedef typename boost::result_of< function(fusion::vector0<> &) >::type call_0_result; - BOOST_FUSION_GPU_ENABLED inline call_0_result operator()() + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline call_0_result operator()() { fusion::vector0<> arg; return this->fnc_transformed(arg); @@ -79,7 +82,7 @@ namespace boost { namespace fusion typedef typename detail::call_param::type func_const_fwd_t; public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit unfused(func_const_fwd_t f = function()) : fnc_transformed(f) { } @@ -149,7 +152,7 @@ namespace boost { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::result_of & )>::type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const @@ -161,7 +164,7 @@ namespace boost } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::result_of & )>::type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) diff --git a/include/boost/fusion/functional/adapter/unfused_typed.hpp b/include/boost/fusion/functional/adapter/unfused_typed.hpp index c3ab33dd..23faf153 100644 --- a/include/boost/fusion/functional/adapter/unfused_typed.hpp +++ b/include/boost/fusion/functional/adapter/unfused_typed.hpp @@ -63,7 +63,7 @@ namespace boost { namespace fusion public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline explicit unfused_typed(func_const_fwd_t f = Function()) : fnc_transformed(f) { } @@ -130,7 +130,7 @@ namespace boost #define M(z,i,s) \ typename call_param::type>::type a##i - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::result_of< function_c(arg_vector_t &) >::type operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) const @@ -143,7 +143,7 @@ namespace boost return static_cast(this)->fnc_transformed(arg); } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::result_of< function(arg_vector_t &) >::type operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) diff --git a/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp b/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp index b7744826..2548a086 100644 --- a/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp +++ b/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::BOOST_FUSION_FUNC_NAME::type BOOST_FUSION_FUNC_NAME(F const & f) { diff --git a/include/boost/fusion/functional/invocation/detail/that_ptr.hpp b/include/boost/fusion/functional/invocation/detail/that_ptr.hpp index a2b4a86a..7a1a5c57 100644 --- a/include/boost/fusion/functional/invocation/detail/that_ptr.hpp +++ b/include/boost/fusion/functional/invocation/detail/that_ptr.hpp @@ -25,13 +25,13 @@ namespace boost { namespace fusion { namespace detail typedef typename remove_reference::type pointee; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * do_get_pointer(T &, pointee * x) { return x; } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * do_get_pointer(T & x, void const *) { return get_pointer(x); @@ -39,20 +39,20 @@ namespace boost { namespace fusion { namespace detail public: - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * get(pointee * x) { return x; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * get(pointee & x) { return boost::addressof(x); } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline pointee * get(T & x) { return do_get_pointer(x, boost::addressof(x)); diff --git a/include/boost/fusion/functional/invocation/invoke.hpp b/include/boost/fusion/functional/invocation/invoke.hpp index 2de4fced..e1373542 100644 --- a/include/boost/fusion/functional/invocation/invoke.hpp +++ b/include/boost/fusion/functional/invocation/invoke.hpp @@ -150,7 +150,7 @@ namespace boost { namespace fusion typedef typename boost::add_reference::type result_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(T C::* f, Sequence & s) { typename result_of::front::type c = fusion::front(s); @@ -173,7 +173,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type invoke(Function f, Sequence & s) { @@ -183,7 +183,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke::type invoke(Function f, Sequence const & s) { @@ -220,7 +220,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -230,7 +230,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -251,7 +251,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -261,7 +261,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -282,7 +282,7 @@ namespace boost { namespace fusion typedef typename ft::result_type::type result_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -318,7 +318,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -330,7 +330,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -353,7 +353,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -365,7 +365,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -387,7 +387,7 @@ namespace boost { namespace fusion typedef typename ft::result_type::type result_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { diff --git a/include/boost/fusion/functional/invocation/invoke_function_object.hpp b/include/boost/fusion/functional/invocation/invoke_function_object.hpp index a5c9510c..6d414f55 100644 --- a/include/boost/fusion/functional/invocation/invoke_function_object.hpp +++ b/include/boost/fusion/functional/invocation/invoke_function_object.hpp @@ -40,12 +40,12 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type invoke_function_object(Function, Sequence &); template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type invoke_function_object(Function, Sequence const &); @@ -81,7 +81,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type invoke_function_object(Function f, Sequence & s) { @@ -91,7 +91,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::invoke_function_object::type invoke_function_object(Function f, Sequence const & s) { @@ -125,7 +125,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -137,7 +137,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { @@ -161,7 +161,7 @@ namespace boost { namespace fusion #if N > 0 template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & s) { @@ -177,7 +177,7 @@ namespace boost { namespace fusion #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline result_type call(F & f, Sequence & /*s*/) { diff --git a/include/boost/fusion/functional/invocation/invoke_procedure.hpp b/include/boost/fusion/functional/invocation/invoke_procedure.hpp index bd3e49b9..028e0fe3 100644 --- a/include/boost/fusion/functional/invocation/invoke_procedure.hpp +++ b/include/boost/fusion/functional/invocation/invoke_procedure.hpp @@ -47,11 +47,11 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void invoke_procedure(Function, Sequence &); template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void invoke_procedure(Function, Sequence const &); //----- ---- --- -- - - - - @@ -77,7 +77,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void invoke_procedure(Function f, Sequence & s) { detail::invoke_procedure_impl< @@ -86,7 +86,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline void invoke_procedure(Function f, Sequence const & s) { detail::invoke_procedure_impl< @@ -113,7 +113,7 @@ namespace boost { namespace fusion #if N > 0 - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & s) { f(BOOST_PP_ENUM(N,M,~)); @@ -121,7 +121,7 @@ namespace boost { namespace fusion #else - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & /*s*/) { f(); @@ -135,7 +135,7 @@ namespace boost { namespace fusion template struct invoke_procedure_impl { - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & s) { (that_ptr 0 - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & s) { typedef typename result_of::begin::type I0; @@ -168,7 +168,7 @@ namespace boost { namespace fusion } #else - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & /*s*/) { f(); @@ -182,7 +182,7 @@ namespace boost { namespace fusion template struct invoke_procedure_impl { - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline void call(Function & f, Sequence & s) { typedef typename result_of::begin::type I0; diff --git a/include/boost/fusion/sequence/comparison/detail/equal_to.hpp b/include/boost/fusion/sequence/comparison/detail/equal_to.hpp index 577023db..cffed6c3 100644 --- a/include/boost/fusion/sequence/comparison/detail/equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/detail/equal_to.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { @@ -54,7 +54,7 @@ namespace boost { namespace fusion { namespace detail struct sequence_equal_to { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& /*a*/, I2 const& /*b*/) { diff --git a/include/boost/fusion/sequence/comparison/detail/greater.hpp b/include/boost/fusion/sequence/comparison/detail/greater.hpp index d875f16b..d7626529 100644 --- a/include/boost/fusion/sequence/comparison/detail/greater.hpp +++ b/include/boost/fusion/sequence/comparison/detail/greater.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp b/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp index e0aa530e..d15d88c4 100644 --- a/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp +++ b/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/detail/less.hpp b/include/boost/fusion/sequence/comparison/detail/less.hpp index 8964ca7d..04377d69 100644 --- a/include/boost/fusion/sequence/comparison/detail/less.hpp +++ b/include/boost/fusion/sequence/comparison/detail/less.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/detail/less_equal.hpp b/include/boost/fusion/sequence/comparison/detail/less_equal.hpp index 10bcb767..e61d33c4 100644 --- a/include/boost/fusion/sequence/comparison/detail/less_equal.hpp +++ b/include/boost/fusion/sequence/comparison/detail/less_equal.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -42,7 +42,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp b/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp index b230ac1f..323b2ac9 100644 --- a/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { namespace detail typedef typename result_of::end::type end2_type; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const&, I2 const&, mpl::true_) { @@ -32,7 +32,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b, mpl::false_) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion { namespace detail } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { @@ -54,7 +54,7 @@ namespace boost { namespace fusion { namespace detail struct sequence_not_equal_to { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static bool call(I1 const& a, I2 const& b) { diff --git a/include/boost/fusion/sequence/comparison/equal_to.hpp b/include/boost/fusion/sequence/comparison/equal_to.hpp index 485df0ba..283ffefc 100644 --- a/include/boost/fusion/sequence/comparison/equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/equal_to.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool equal_to(Seq1 const& a, Seq2 const& b) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_equality diff --git a/include/boost/fusion/sequence/comparison/greater.hpp b/include/boost/fusion/sequence/comparison/greater.hpp index 5ad7ef74..fbbb7bfa 100644 --- a/include/boost/fusion/sequence/comparison/greater.hpp +++ b/include/boost/fusion/sequence/comparison/greater.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool greater(Seq1 const& a, Seq2 const& b) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison diff --git a/include/boost/fusion/sequence/comparison/greater_equal.hpp b/include/boost/fusion/sequence/comparison/greater_equal.hpp index 65904f83..7b91a888 100644 --- a/include/boost/fusion/sequence/comparison/greater_equal.hpp +++ b/include/boost/fusion/sequence/comparison/greater_equal.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool greater_equal(Seq1 const& a, Seq2 const& b) { @@ -38,7 +38,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison diff --git a/include/boost/fusion/sequence/comparison/less.hpp b/include/boost/fusion/sequence/comparison/less.hpp index 28762b73..b056552a 100644 --- a/include/boost/fusion/sequence/comparison/less.hpp +++ b/include/boost/fusion/sequence/comparison/less.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool less(Seq1 const& a, Seq2 const& b) { @@ -29,7 +29,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison diff --git a/include/boost/fusion/sequence/comparison/less_equal.hpp b/include/boost/fusion/sequence/comparison/less_equal.hpp index d0668208..53159926 100644 --- a/include/boost/fusion/sequence/comparison/less_equal.hpp +++ b/include/boost/fusion/sequence/comparison/less_equal.hpp @@ -24,7 +24,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool less_equal(Seq1 const& a, Seq2 const& b) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion #if defined(BOOST_MSVC) && (BOOST_MSVC <= 1400) // Workaround for VC8.0 and VC7.1 template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool operator<=(sequence_base const& a, sequence_base const& b) { @@ -49,7 +49,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename disable_if, bool>::type operator<=(sequence_base const& a, Seq2 const& b) { @@ -57,7 +57,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename disable_if, bool>::type operator<=(Seq1 const& a, sequence_base const& b) { @@ -69,7 +69,7 @@ namespace boost { namespace fusion // but barfs somewhere else. template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_comparison diff --git a/include/boost/fusion/sequence/comparison/not_equal_to.hpp b/include/boost/fusion/sequence/comparison/not_equal_to.hpp index 4cd94f9e..fc2fef33 100644 --- a/include/boost/fusion/sequence/comparison/not_equal_to.hpp +++ b/include/boost/fusion/sequence/comparison/not_equal_to.hpp @@ -23,7 +23,7 @@ namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool not_equal_to(Seq1 const& a, Seq2 const& b) { @@ -41,7 +41,7 @@ namespace boost { namespace fusion namespace operators { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename boost::enable_if< traits::enable_equality diff --git a/include/boost/fusion/sequence/convert.hpp b/include/boost/fusion/sequence/convert.hpp index 461b9212..b367714c 100644 --- a/include/boost/fusion/sequence/convert.hpp +++ b/include/boost/fusion/sequence/convert.hpp @@ -7,6 +7,8 @@ #if !defined(FUSION_CONVERT_10022005_1442) #define FUSION_CONVERT_10022005_1442 +#include + namespace boost { namespace fusion { namespace extension @@ -29,7 +31,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::convert::type convert(Sequence& seq) { @@ -38,7 +40,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::convert::type convert(Sequence const& seq) { diff --git a/include/boost/fusion/support/as_const.hpp b/include/boost/fusion/support/as_const.hpp index ed535970..04d5bfcc 100644 --- a/include/boost/fusion/support/as_const.hpp +++ b/include/boost/fusion/support/as_const.hpp @@ -7,6 +7,9 @@ #ifndef BOOST_FUSION_SUPPORT_AS_CONST_HPP #define BOOST_FUSION_SUPPORT_AS_CONST_HPP +#include +#include + namespace boost { namespace fusion { namespace extension { // A customization point that allows certain wrappers around @@ -16,8 +19,8 @@ namespace boost { namespace fusion { namespace extension // such contexts with calls to this function. Users can // specialize this function for their own wrappers. template - BOOST_FUSION_GPU_ENABLED - const T& as_const(const T& obj) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline const T& as_const(const T& obj) BOOST_NOEXCEPT { return obj; } diff --git a/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp b/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp index 514e8d95..6a388bf8 100644 --- a/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp +++ b/include/boost/fusion/support/detail/segmented_fold_until_impl.hpp @@ -66,8 +66,8 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED - typename result_of::make_segmented_iterator::type + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + inline typename result_of::make_segmented_iterator::type make_segmented_iterator(Cur const& cur, Context const& context) { typedef result_of::make_segmented_iterator impl_type; @@ -121,7 +121,7 @@ namespace boost { namespace fusion typedef iterator_range range_type; typedef cons type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Cur const& cur, End const& end, Context const& context) { return cons(range_type(cur, end), context); @@ -170,7 +170,7 @@ namespace boost { namespace fusion typedef typename impl::type type; typedef typename impl::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun) { return impl::call(fusion::segments(seq), state, context, fun); @@ -192,7 +192,7 @@ namespace boost { namespace fusion typedef typename apply_type::type type; typedef typename apply_type::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq, State const& state, Context const& context, Fun const& fun) { return apply_type::call(seq, state, context, fun); @@ -274,14 +274,14 @@ namespace boost { namespace fusion >::type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun) { return call(beg, end, state, context, fun, typename fold_recurse_impl::continue_type()); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun, mpl::true_) // continue { @@ -297,7 +297,7 @@ namespace boost { namespace fusion , fun); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun, mpl::false_) // break { @@ -325,7 +325,7 @@ namespace boost { namespace fusion typedef typename impl::type type; typedef typename impl::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun) { @@ -351,7 +351,7 @@ namespace boost { namespace fusion typedef typename impl::type type; typedef typename impl::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& beg, End const& end, State const& state , Context const& context, Fun const& fun) { @@ -365,7 +365,7 @@ namespace boost { namespace fusion typedef State type; typedef mpl::true_ continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const&, End const&, State const& state , Context const&, Fun const&) { @@ -389,7 +389,7 @@ namespace boost { namespace fusion typedef typename impl::type type; typedef typename impl::continue_type continue_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Segments& segs, State const& state, Context const& context, Fun const& fun) { return impl::call(fusion::begin(segs), fusion::end(segs), state, context, fun); diff --git a/include/boost/fusion/support/iterator_base.hpp b/include/boost/fusion/support/iterator_base.hpp index d23d05c6..5d8ce3ab 100644 --- a/include/boost/fusion/support/iterator_base.hpp +++ b/include/boost/fusion/support/iterator_base.hpp @@ -7,6 +7,7 @@ #if !defined(FUSION_ITERATOR_BASE_05042005_1008) #define FUSION_ITERATOR_BASE_05042005_1008 +#include #include namespace boost { namespace fusion @@ -16,16 +17,16 @@ namespace boost { namespace fusion template struct iterator_base : iterator_root { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED Iterator const& - cast() const + cast() const BOOST_NOEXCEPT { return static_cast(*this); } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED Iterator& - cast() + cast() BOOST_NOEXCEPT { return static_cast(*this); } diff --git a/include/boost/fusion/support/pair.hpp b/include/boost/fusion/support/pair.hpp index b09c7b4b..fd5d57e6 100644 --- a/include/boost/fusion/support/pair.hpp +++ b/include/boost/fusion/support/pair.hpp @@ -29,51 +29,47 @@ namespace boost { namespace fusion template struct pair { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair() : second() {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(pair const& rhs) : second(rhs.second) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(pair&& rhs) : second(BOOST_FUSION_FWD_ELEM(Second, rhs.second)) {} - #endif - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(typename detail::call_param::type val) : second(val) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - - BOOST_FUSION_GPU_ENABLED template + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(Second2&& val , typename boost::disable_if >::type* /* dummy */ = 0 , typename boost::enable_if >::type* /*dummy*/ = 0 ) : second(BOOST_FUSION_FWD_ELEM(Second, val)) {} - #endif template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair(pair const& rhs) : second(rhs.second) {} template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair& operator=(pair const& rhs) { second = rhs.second; return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair& operator=(pair const& rhs) { second = rhs.second; @@ -81,7 +77,7 @@ namespace boost { namespace fusion } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED pair& operator=(pair&& rhs) { second = BOOST_FUSION_FWD_ELEM(Second, rhs.second); @@ -117,7 +113,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::make_pair::type make_pair(Second const& val) { @@ -141,7 +137,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool operator==(pair const& l, pair const& r) { @@ -149,7 +145,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool operator!=(pair const& l, pair const& r) { @@ -157,7 +153,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline bool operator<(pair const& l, pair const& r) { diff --git a/include/boost/fusion/support/segmented_fold_until.hpp b/include/boost/fusion/support/segmented_fold_until.hpp index cf01fea4..9e6f4a50 100644 --- a/include/boost/fusion/support/segmented_fold_until.hpp +++ b/include/boost/fusion/support/segmented_fold_until.hpp @@ -45,7 +45,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename lazy_disable_if< is_const @@ -56,19 +56,19 @@ namespace boost { namespace fusion typedef typename result_of::segmented_fold_until::filter filter; - + return filter::call(seq, state, fusion::nil_(), fun); } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::segmented_fold_until::type segmented_fold_until(Sequence const& seq, State const& state, Fun const& fun) { typedef typename result_of::segmented_fold_until::filter filter; - + return filter::call(seq, state, fusion::nil_(), fun); } }} diff --git a/include/boost/fusion/support/sequence_base.hpp b/include/boost/fusion/support/sequence_base.hpp index b59121c0..2f9320e6 100644 --- a/include/boost/fusion/support/sequence_base.hpp +++ b/include/boost/fusion/support/sequence_base.hpp @@ -8,6 +8,7 @@ #if !defined(FUSION_SEQUENCE_BASE_04182005_0737) #define FUSION_SEQUENCE_BASE_04182005_0737 +#include #include #include @@ -22,22 +23,22 @@ namespace boost { namespace fusion template struct sequence_base { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED Sequence const& - derived() const + derived() const BOOST_NOEXCEPT { return static_cast(*this); } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED Sequence& - derived() + derived() BOOST_NOEXCEPT { return static_cast(*this); } - BOOST_FUSION_GPU_ENABLED - operator detail::from_sequence_convertible_type()const + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + operator detail::from_sequence_convertible_type() const BOOST_NOEXCEPT { return detail::from_sequence_convertible_type(); } diff --git a/include/boost/fusion/support/unused.hpp b/include/boost/fusion/support/unused.hpp index b3eec5ce..4bbe24e8 100644 --- a/include/boost/fusion/support/unused.hpp +++ b/include/boost/fusion/support/unused.hpp @@ -22,65 +22,67 @@ namespace boost { namespace fusion { struct unused_type { - BOOST_FUSION_GPU_ENABLED - unused_type() + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + unused_type() BOOST_NOEXCEPT { } template - BOOST_FUSION_GPU_ENABLED - unused_type(T const&) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + unused_type(T const&) BOOST_NOEXCEPT { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type const& - operator=(T const&) const + operator=(T const&) const BOOST_NOEXCEPT { return *this; } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type& - operator=(T const&) + operator=(T const&) BOOST_NOEXCEPT { return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type const& - operator=(unused_type const&) const + operator=(unused_type const&) const BOOST_NOEXCEPT { return *this; } - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type& - operator=(unused_type const&) + operator=(unused_type const&) BOOST_NOEXCEPT { return *this; } }; - unused_type const unused = unused_type(); + BOOST_CONSTEXPR unused_type const unused = unused_type(); namespace detail { struct unused_only { - BOOST_FUSION_GPU_ENABLED - unused_only(unused_type const&) {} + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + unused_only(unused_type const&) BOOST_NOEXCEPT {} }; } - inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&) + BOOST_CONSTEXPR + inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&) BOOST_NOEXCEPT { return out; } - inline std::istream& operator>>(std::istream& in, unused_type&) + BOOST_CONSTEXPR + inline std::istream& operator>>(std::istream& in, unused_type&) BOOST_NOEXCEPT { return in; } diff --git a/include/boost/fusion/view/detail/strictest_traversal.hpp b/include/boost/fusion/view/detail/strictest_traversal.hpp index 4092ea4d..9ad1f7aa 100644 --- a/include/boost/fusion/view/detail/strictest_traversal.hpp +++ b/include/boost/fusion/view/detail/strictest_traversal.hpp @@ -59,7 +59,7 @@ namespace boost { namespace fusion // never called, but needed for decltype-based result_of (C++0x) #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(StrictestSoFar&&, Next&&) const; #endif diff --git a/include/boost/fusion/view/filter_view/detail/begin_impl.hpp b/include/boost/fusion/view/filter_view/detail/begin_impl.hpp index 89f67d02..3ce439a4 100644 --- a/include/boost/fusion/view/filter_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/begin_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typedef typename Sequence::category category; typedef filter_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp b/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp index ba8631f5..e0d9a0ed 100644 --- a/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion { namespace extension result_of::deref_data::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/filter_view/detail/end_impl.hpp b/include/boost/fusion/view/filter_view/detail/end_impl.hpp index fee9f6d4..1a2a5ba4 100644 --- a/include/boost/fusion/view/filter_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/end_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion typedef typename Sequence::category category; typedef filter_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/filter_view/detail/next_impl.hpp b/include/boost/fusion/view/filter_view/detail/next_impl.hpp index 0091e897..4f174557 100644 --- a/include/boost/fusion/view/filter_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/filter_view/detail/next_impl.hpp @@ -63,7 +63,7 @@ namespace boost { namespace fusion category, typename filter::type, last_type, pred_type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/filter_view/filter_view.hpp b/include/boost/fusion/view/filter_view/filter_view.hpp index dd710fab..db61cad6 100644 --- a/include/boost/fusion/view/filter_view/filter_view.hpp +++ b/include/boost/fusion/view/filter_view/filter_view.hpp @@ -46,14 +46,14 @@ namespace boost { namespace fusion typedef typename result_of::end::type last_type; typedef Pred pred_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED filter_view(Sequence& in_seq) : seq(in_seq) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last_type last() const { return fusion::end(seq); } typename mpl::if_, Sequence, Sequence&>::type seq; diff --git a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp index 14aaa460..1a4197c5 100644 --- a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp +++ b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp @@ -55,7 +55,7 @@ namespace boost { namespace fusion typedef last_iter last_type; typedef Pred pred_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED filter_iterator(First const& in_first) : first(filter::iter_call(first_converter::call(in_first))) {} diff --git a/include/boost/fusion/view/flatten_view/flatten_view.hpp b/include/boost/fusion/view/flatten_view/flatten_view.hpp index aa472407..8e40158d 100644 --- a/include/boost/fusion/view/flatten_view/flatten_view.hpp +++ b/include/boost/fusion/view/flatten_view/flatten_view.hpp @@ -8,6 +8,7 @@ #define BOOST_FUSION_FLATTEN_VIEW_HPP_INCLUDED +#include #include #include #include @@ -23,7 +24,7 @@ namespace boost { namespace fusion { struct forward_traversal_tag; struct flatten_view_tag; - + template struct flatten_view : sequence_base > @@ -32,18 +33,21 @@ namespace boost { namespace fusion typedef fusion_sequence_tag tag; // this gets picked up by MPL typedef mpl::true_ is_view; typedef forward_traversal_tag category; - + typedef Sequence sequence_type; typedef typename result_of::begin::type first_type; typedef typename result_of::end::type last_type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit flatten_view(Sequence& seq) : seq(seq) {} - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq); } + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last_type last() const { return fusion::end(seq); } - + typename mpl::if_, Sequence, Sequence&>::type seq; }; }} @@ -57,19 +61,20 @@ namespace boost { namespace fusion { namespace extension struct apply { typedef typename Sequence::first_type first_type; - + typedef typename result_of::begin< mpl::single_view< typename Sequence::sequence_type> >::type root_iterator; - + typedef detail::seek_descent seek_descent; - + typedef typename seek_descent::type type; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(Sequence& seq) { @@ -77,7 +82,7 @@ namespace boost { namespace fusion { namespace extension } }; }; - + template<> struct end_impl { @@ -85,13 +90,14 @@ namespace boost { namespace fusion { namespace extension struct apply { typedef typename Sequence::last_type last_type; - + typedef typename result_of::end< mpl::single_view< typename Sequence::sequence_type> >::type type; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(Sequence&) { diff --git a/include/boost/fusion/view/flatten_view/flatten_view_iterator.hpp b/include/boost/fusion/view/flatten_view/flatten_view_iterator.hpp index dfe613ac..f82a5266 100644 --- a/include/boost/fusion/view/flatten_view/flatten_view_iterator.hpp +++ b/include/boost/fusion/view/flatten_view/flatten_view_iterator.hpp @@ -8,6 +8,7 @@ #define BOOST_FUSION_FLATTEN_VIEW_ITERATOR_HPP_INCLUDED +#include #include #include #include @@ -23,22 +24,23 @@ namespace boost { namespace fusion { struct forward_traversal_tag; struct flatten_view_iterator_tag; - + template struct flatten_view_iterator : iterator_base > { typedef flatten_view_iterator_tag fusion_tag; typedef forward_traversal_tag category; - + typedef convert_iterator first_converter; typedef typename first_converter::type first_type; typedef Base base_type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED flatten_view_iterator(First const& first, Base const& base) : first(first), base(base) {} - + first_type first; base_type base; }; @@ -50,13 +52,14 @@ namespace boost { namespace fusion { namespace detail struct make_descent_cons { typedef cons type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(Iterator const& it) { return type(it); } }; - + template struct make_descent_cons::type>::type sub_sequence; - + typedef typename result_of::begin::type sub_begin; - + typedef cons::type> type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(Iterator const& it) { return type(it, make_descent_cons::apply( fusion::begin(*it))); } }; - + template struct build_flatten_view_iterator; @@ -88,26 +92,28 @@ namespace boost { namespace fusion { namespace detail struct build_flatten_view_iterator, Base> { typedef flatten_view_iterator type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(cons const& cons, Base const& base) { return type(cons.car, base); } }; - + template struct build_flatten_view_iterator, Base> { typedef flatten_view_iterator next_base; typedef build_flatten_view_iterator next; typedef typename next::type type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(cons const& cons, Base const& base) { return next::apply(cons.cdr, next_base(cons.car, base)); } }; - + template struct seek_descent { @@ -117,14 +123,15 @@ namespace boost { namespace fusion { namespace detail build_flatten_view_iterator build_flatten_view_iterator_; typedef typename build_flatten_view_iterator_::type type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(Base const& base, Iterator const& it) { return build_flatten_view_iterator_::apply( make_descent_cons_::apply(it), base); } }; - + template struct seek_descent::type>::type> >::type> { typedef typename result_of::next::type type; - + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type apply(Base const& base, Iterator const&) { return fusion::next(base); @@ -151,10 +159,11 @@ namespace boost { namespace fusion { namespace extension typedef typename Iterator::first_type first_type; typedef typename Iterator::base_type base_type; typedef typename result_of::next::type next_type; - + typedef detail::seek_descent seek_descent; typedef typename seek_descent::type type; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(Iterator const& it) { @@ -162,7 +171,7 @@ namespace boost { namespace fusion { namespace extension } }; }; - + template<> struct deref_impl { @@ -173,6 +182,7 @@ namespace boost { namespace fusion { namespace extension result_of::deref::type type; + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static inline type call(Iterator const& it) { @@ -180,13 +190,13 @@ namespace boost { namespace fusion { namespace extension } }; }; - + template<> struct value_of_impl { template struct apply - { + { typedef typename result_of::value_of::type type; diff --git a/include/boost/fusion/view/iterator_range/detail/at_impl.hpp b/include/boost/fusion/view/iterator_range/detail/at_impl.hpp index 0626ae2e..20f17583 100644 --- a/include/boost/fusion/view/iterator_range/detail/at_impl.hpp +++ b/include/boost/fusion/view/iterator_range/detail/at_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typedef typename result_of::advance::type pos; typedef typename result_of::deref::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& s) { diff --git a/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp b/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp index e34b6ede..7e00dec0 100644 --- a/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp +++ b/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp @@ -7,6 +7,8 @@ #if !defined(FUSION_BEGIN_IMPL_05062005_1226) #define FUSION_BEGIN_IMPL_05062005_1226 +#include + namespace boost { namespace fusion { struct iterator_range_tag; @@ -24,7 +26,7 @@ namespace boost { namespace fusion { typedef typename Sequence::begin_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/iterator_range/detail/end_impl.hpp b/include/boost/fusion/view/iterator_range/detail/end_impl.hpp index 2428198c..b76aa91c 100644 --- a/include/boost/fusion/view/iterator_range/detail/end_impl.hpp +++ b/include/boost/fusion/view/iterator_range/detail/end_impl.hpp @@ -7,6 +7,8 @@ #if !defined(FUSION_END_IMPL_05062005_1226) #define FUSION_END_IMPL_05062005_1226 +#include + namespace boost { namespace fusion { struct iterator_range_tag; @@ -24,7 +26,7 @@ namespace boost { namespace fusion { typedef typename Sequence::end_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp index 9a744a59..d35e580f 100644 --- a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp +++ b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp @@ -48,7 +48,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename lazy_enable_if< traits::is_sequence @@ -57,7 +57,7 @@ namespace boost { namespace fusion push_back(Sequence const& seq, T const& x); template - BOOST_FUSION_GPU_ENABLED + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename lazy_enable_if< traits::is_sequence @@ -152,7 +152,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { //return segment_sequence( @@ -199,7 +199,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { // return iterator_range(begin(car(cdr(stack_begin))), end(front(car(stack_begin)))); @@ -212,7 +212,7 @@ namespace boost { namespace fusion { namespace detail { typedef typename Stack::cdr_type type; // nil_ - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const &stack) { return stack.cdr; @@ -298,7 +298,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { // return segment_sequence( @@ -345,7 +345,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { // return iterator_range(begin(front(car(stack_end))), begin(car(cdr(stack_end)))); @@ -358,7 +358,7 @@ namespace boost { namespace fusion { namespace detail { typedef typename Stack::cdr_type type; // nil_ - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Stack const& stack) { return stack.cdr; @@ -437,7 +437,7 @@ namespace boost { namespace fusion { namespace detail > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(StackBegin stack_begin, StackEnd stack_end) { //return segment_sequence( @@ -471,7 +471,7 @@ namespace boost { namespace fusion { namespace detail typename impl::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(StackBegin stack_begin, StackEnd stack_end) { return impl::call(stack_begin.cdr, stack_end.cdr); @@ -501,7 +501,7 @@ namespace boost { namespace fusion { namespace detail segment_sequence type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(StackBegin stack_begin, StackEnd stack_end) { //return segment_sequence( @@ -531,7 +531,7 @@ namespace boost { namespace fusion { namespace detail typedef typename impl::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Begin const& begin, End const& end) { return impl::call( diff --git a/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp b/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp index 9d570cf1..bbf4c45a 100644 --- a/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp +++ b/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion typename result_of::segments::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence & seq) { return fusion::segments(impl::call(seq.first, seq.last)); diff --git a/include/boost/fusion/view/iterator_range/iterator_range.hpp b/include/boost/fusion/view/iterator_range/iterator_range.hpp index f5aafd4a..272abcd9 100644 --- a/include/boost/fusion/view/iterator_range/iterator_range.hpp +++ b/include/boost/fusion/view/iterator_range/iterator_range.hpp @@ -44,7 +44,7 @@ namespace boost { namespace fusion typedef typename traits::category_of::type category; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED iterator_range(First const& in_first, Last const& in_last) : first(convert_iterator::call(in_first)) , last(convert_iterator::call(in_last)) {} diff --git a/include/boost/fusion/view/joint_view/detail/begin_impl.hpp b/include/boost/fusion/view/joint_view/detail/begin_impl.hpp index f58d1290..b7a961a7 100644 --- a/include/boost/fusion/view/joint_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/joint_view/detail/begin_impl.hpp @@ -43,21 +43,21 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s, mpl::true_) { return s.concat(); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s, mpl::false_) { return type(s.first(), s.concat()); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp b/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp index 02780d99..2d5f8317 100644 --- a/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp +++ b/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion { namespace extension result_of::deref_data::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/joint_view/detail/end_impl.hpp b/include/boost/fusion/view/joint_view/detail/end_impl.hpp index b9e01138..0b4b9b0a 100644 --- a/include/boost/fusion/view/joint_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/joint_view/detail/end_impl.hpp @@ -28,7 +28,7 @@ namespace boost { namespace fusion { typedef typename Sequence::concat_last_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/joint_view/detail/next_impl.hpp b/include/boost/fusion/view/joint_view/detail/next_impl.hpp index a3c066d1..a7d18757 100644 --- a/include/boost/fusion/view/joint_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/joint_view/detail/next_impl.hpp @@ -45,21 +45,21 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i, mpl::true_) { return i.concat; } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i, mpl::false_) { return type(fusion::next(i.first), i.concat); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/joint_view/joint_view.hpp b/include/boost/fusion/view/joint_view/joint_view.hpp index 3ad31914..676cbc54 100644 --- a/include/boost/fusion/view/joint_view/joint_view.hpp +++ b/include/boost/fusion/view/joint_view/joint_view.hpp @@ -56,17 +56,17 @@ namespace boost { namespace fusion result_of::size::value + result_of::size::value> size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED joint_view(Sequence1& in_seq1, Sequence2& in_seq2) : seq1(in_seq1) , seq2(in_seq2) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq1); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED concat_type concat() const { return fusion::begin(seq2); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED concat_last_type concat_last() const { return fusion::end(seq2); } private: diff --git a/include/boost/fusion/view/joint_view/joint_view_iterator.hpp b/include/boost/fusion/view/joint_view/joint_view_iterator.hpp index 98584740..d75ca90d 100644 --- a/include/boost/fusion/view/joint_view/joint_view_iterator.hpp +++ b/include/boost/fusion/view/joint_view/joint_view_iterator.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion typedef Category category; BOOST_STATIC_ASSERT((!result_of::equal_to::value)); - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED joint_view_iterator(First const& in_first, Concat const& in_concat) : first(first_converter::call(in_first)) , concat(concat_converter::call(in_concat)) diff --git a/include/boost/fusion/view/nview/detail/advance_impl.hpp b/include/boost/fusion/view/nview/detail/advance_impl.hpp index ad82983e..7c74a386 100644 --- a/include/boost/fusion/view/nview/detail/advance_impl.hpp +++ b/include/boost/fusion/view/nview/detail/advance_impl.hpp @@ -12,7 +12,7 @@ #include #include -namespace boost { namespace fusion +namespace boost { namespace fusion { struct nview_iterator_tag; @@ -36,7 +36,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/nview/detail/at_impl.hpp b/include/boost/fusion/view/nview/detail/at_impl.hpp index 45f9faf6..b9f41def 100644 --- a/include/boost/fusion/view/nview/detail/at_impl.hpp +++ b/include/boost/fusion/view/nview/detail/at_impl.hpp @@ -11,7 +11,7 @@ #include #include -namespace boost { namespace fusion +namespace boost { namespace fusion { struct nview_tag; @@ -32,8 +32,8 @@ namespace boost { namespace fusion typedef typename result_of::at::type index; typedef typename result_of::at::type type; - BOOST_FUSION_GPU_ENABLED - static type + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + static type call(Sequence& seq) { return fusion::at(seq.seq); diff --git a/include/boost/fusion/view/nview/detail/begin_impl.hpp b/include/boost/fusion/view/nview/detail/begin_impl.hpp index ca600b9a..bab5e221 100644 --- a/include/boost/fusion/view/nview/detail/begin_impl.hpp +++ b/include/boost/fusion/view/nview/detail/begin_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { return type(s); diff --git a/include/boost/fusion/view/nview/detail/deref_impl.hpp b/include/boost/fusion/view/nview/detail/deref_impl.hpp index bbdb9825..85991021 100644 --- a/include/boost/fusion/view/nview/detail/deref_impl.hpp +++ b/include/boost/fusion/view/nview/detail/deref_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typedef typename result_of::at< typename sequence_type::sequence_type, index>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return at(i.seq.seq); diff --git a/include/boost/fusion/view/nview/detail/distance_impl.hpp b/include/boost/fusion/view/nview/detail/distance_impl.hpp index e3e5a9a0..a036300f 100644 --- a/include/boost/fusion/view/nview/detail/distance_impl.hpp +++ b/include/boost/fusion/view/nview/detail/distance_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion typename First::first_type, typename Last::first_type >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& /*first*/, Last const& /*last*/) { diff --git a/include/boost/fusion/view/nview/detail/end_impl.hpp b/include/boost/fusion/view/nview/detail/end_impl.hpp index d36260db..0a6efe56 100644 --- a/include/boost/fusion/view/nview/detail/end_impl.hpp +++ b/include/boost/fusion/view/nview/detail/end_impl.hpp @@ -36,7 +36,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { return type(s); diff --git a/include/boost/fusion/view/nview/detail/next_impl.hpp b/include/boost/fusion/view/nview/detail/next_impl.hpp index 5193bfe6..3c304096 100644 --- a/include/boost/fusion/view/nview/detail/next_impl.hpp +++ b/include/boost/fusion/view/nview/detail/next_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/nview/detail/nview_impl.hpp b/include/boost/fusion/view/nview/detail/nview_impl.hpp index 6c7a3e21..e0d93356 100644 --- a/include/boost/fusion/view/nview/detail/nview_impl.hpp +++ b/include/boost/fusion/view/nview/detail/nview_impl.hpp @@ -63,7 +63,7 @@ namespace boost { namespace fusion { namespace result_of namespace boost { namespace fusion { template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline nview > as_nview(Sequence& s) { diff --git a/include/boost/fusion/view/nview/detail/prior_impl.hpp b/include/boost/fusion/view/nview/detail/prior_impl.hpp index 374b45f6..470c5bd3 100644 --- a/include/boost/fusion/view/nview/detail/prior_impl.hpp +++ b/include/boost/fusion/view/nview/detail/prior_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef nview_iterator::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/nview/nview.hpp b/include/boost/fusion/view/nview/nview.hpp index 45b7380b..2e257c81 100644 --- a/include/boost/fusion/view/nview/nview.hpp +++ b/include/boost/fusion/view/nview/nview.hpp @@ -40,7 +40,7 @@ namespace boost { namespace fusion #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type operator()(T& x) const { @@ -48,7 +48,7 @@ namespace boost { namespace fusion } #else template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(T&& x) const { @@ -68,7 +68,7 @@ namespace boost { namespace fusion {}; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type operator()(T& x) const { @@ -76,7 +76,7 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename add_reference::type>::type operator()(T const& x) const { @@ -108,7 +108,8 @@ namespace boost { namespace fusion typedef typename result_of::as_vector::type sequence_type; - BOOST_FUSION_GPU_ENABLED explicit nview(Sequence& val) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit nview(Sequence& val) : seq(sequence_type(transform_view_type(val, transform_type()))) {} diff --git a/include/boost/fusion/view/nview/nview_iterator.hpp b/include/boost/fusion/view/nview/nview_iterator.hpp index c614cbbb..cb2541b5 100644 --- a/include/boost/fusion/view/nview/nview_iterator.hpp +++ b/include/boost/fusion/view/nview/nview_iterator.hpp @@ -42,7 +42,8 @@ namespace boost { namespace fusion typedef Sequence sequence_type; typedef mpl_iterator first_type; - BOOST_FUSION_GPU_ENABLED explicit nview_iterator(Sequence& in_seq) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit nview_iterator(Sequence& in_seq) : seq(in_seq) {} Sequence& seq; diff --git a/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp index 3da6b21d..9a27156c 100644 --- a/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef repetitive_view_iterator::type > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(View const& v) { return type(v.seq); diff --git a/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp index c54ff38e..c96ef5eb 100644 --- a/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion result_of::deref::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return *i.pos; diff --git a/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp index ca1c270f..af1fa6ee 100644 --- a/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef repetitive_view_iterator::type > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(View const& v) { return type(v.seq,end(v.seq)); diff --git a/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp index acefd513..fab75408 100644 --- a/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp @@ -42,7 +42,7 @@ namespace boost { namespace fusion > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return type(i.seq, next(i.pos)); @@ -59,7 +59,7 @@ namespace boost { namespace fusion > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return type(i.seq); @@ -80,7 +80,7 @@ namespace boost { namespace fusion typedef Iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { return type(i); diff --git a/include/boost/fusion/view/repetitive_view/repetitive_view.hpp b/include/boost/fusion/view/repetitive_view/repetitive_view.hpp index ab0a3b18..32718e04 100644 --- a/include/boost/fusion/view/repetitive_view/repetitive_view.hpp +++ b/include/boost/fusion/view/repetitive_view/repetitive_view.hpp @@ -38,7 +38,7 @@ namespace boost { namespace fusion mpl::if_, Sequence, sequence_type&>::type stored_seq_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED repetitive_view(Sequence& in_seq) : seq(in_seq) {} diff --git a/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp b/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp index b9f45d0c..df2f228c 100644 --- a/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp +++ b/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp @@ -36,16 +36,16 @@ namespace boost { namespace fusion typedef typename convert_iterator::type>::type end_type; typedef single_pass_traversal_tag category; - BOOST_FUSION_GPU_ENABLED explicit repetitive_view_iterator(Sequence& in_seq) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit repetitive_view_iterator(Sequence& in_seq) : seq(in_seq), pos(begin(in_seq)) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED repetitive_view_iterator(Sequence& in_seq, pos_type const& in_pos) : seq(in_seq), pos(in_pos) {} Sequence& seq; pos_type pos; - private: // silence MSVC warning C4512: assignment operator could not be generated diff --git a/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp b/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp index 1304d0a9..42b3bd19 100644 --- a/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion { typedef typename result_of::advance::type advanced_type; typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/reverse_view/detail/at_impl.hpp b/include/boost/fusion/view/reverse_view/detail/at_impl.hpp index ebad8f35..d1fc7715 100644 --- a/include/boost/fusion/view/reverse_view/detail/at_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/at_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion { namespace extension result_of::at::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp b/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp index 2f20df57..913725ed 100644 --- a/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& s) { diff --git a/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp b/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp index 20d381ba..e93b8fba 100644 --- a/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp @@ -26,7 +26,7 @@ namespace boost { namespace fusion { namespace extension result_of::deref_data::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp b/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp index 530921fe..9ea60d81 100644 --- a/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion >::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp b/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp index 3a5fdc61..49436c26 100644 --- a/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { typedef typename Last::first_type last_type; typedef typename result_of::distance::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& first, Last const& last) { diff --git a/include/boost/fusion/view/reverse_view/detail/end_impl.hpp b/include/boost/fusion/view/reverse_view/detail/end_impl.hpp index 1747d64f..06602c0e 100644 --- a/include/boost/fusion/view/reverse_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/end_impl.hpp @@ -27,7 +27,7 @@ namespace boost { namespace fusion { typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence const& s) { diff --git a/include/boost/fusion/view/reverse_view/detail/next_impl.hpp b/include/boost/fusion/view/reverse_view/detail/next_impl.hpp index 1aaa6920..58c1f5f7 100644 --- a/include/boost/fusion/view/reverse_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/next_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp b/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp index 4007ad4d..69d18501 100644 --- a/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion typedef reverse_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/reverse_view/reverse_view.hpp b/include/boost/fusion/view/reverse_view/reverse_view.hpp index 3b134d5f..0a9aca27 100644 --- a/include/boost/fusion/view/reverse_view/reverse_view.hpp +++ b/include/boost/fusion/view/reverse_view/reverse_view.hpp @@ -50,14 +50,14 @@ namespace boost { namespace fusion bidirectional_traversal_tag , typename traits::category_of::type>::value)); - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED reverse_view(Sequence& in_seq) : seq(in_seq) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last_type last() const { return fusion::end(seq); } typename mpl::if_, Sequence, Sequence&>::type seq; diff --git a/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp b/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp index 9de2169e..d1d023a2 100644 --- a/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp +++ b/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp @@ -42,7 +42,7 @@ namespace boost { namespace fusion bidirectional_traversal_tag , category>::value)); - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED reverse_view_iterator(First const& in_first) : first(converter::call(in_first)) {} diff --git a/include/boost/fusion/view/single_view/detail/advance_impl.hpp b/include/boost/fusion/view/single_view/detail/advance_impl.hpp index 9dd9e4d7..5af22321 100644 --- a/include/boost/fusion/view/single_view/detail/advance_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/advance_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typename mpl::plus::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/single_view/detail/at_impl.hpp b/include/boost/fusion/view/single_view/detail/at_impl.hpp index b63497c8..6c4c7579 100644 --- a/include/boost/fusion/view/single_view/detail/at_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/at_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion BOOST_MPL_ASSERT((mpl::equal_to >)); typedef typename Sequence::value_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/view/single_view/detail/begin_impl.hpp b/include/boost/fusion/view/single_view/detail/begin_impl.hpp index 63e42923..d6bca8f6 100644 --- a/include/boost/fusion/view/single_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/begin_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion { typedef single_view_iterator > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/view/single_view/detail/deref_impl.hpp b/include/boost/fusion/view/single_view/detail/deref_impl.hpp index ad50a413..acb90d83 100644 --- a/include/boost/fusion/view/single_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/deref_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion BOOST_MPL_ASSERT((mpl::equal_to >)); typedef typename Iterator::value_type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/single_view/detail/distance_impl.hpp b/include/boost/fusion/view/single_view/detail/distance_impl.hpp index 73231b41..9cd85fdc 100644 --- a/include/boost/fusion/view/single_view/detail/distance_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/distance_impl.hpp @@ -30,7 +30,7 @@ namespace boost { namespace fusion typedef typename mpl::minus::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(First const& /*first*/, Last const& /*last*/) { diff --git a/include/boost/fusion/view/single_view/detail/end_impl.hpp b/include/boost/fusion/view/single_view/detail/end_impl.hpp index 50a7c562..d662ac24 100644 --- a/include/boost/fusion/view/single_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/end_impl.hpp @@ -31,7 +31,7 @@ namespace boost { namespace fusion { typedef single_view_iterator > type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& seq) { diff --git a/include/boost/fusion/view/single_view/detail/next_impl.hpp b/include/boost/fusion/view/single_view/detail/next_impl.hpp index d5e0ac80..41c658f3 100644 --- a/include/boost/fusion/view/single_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/next_impl.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typename mpl::next::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/single_view/detail/prior_impl.hpp b/include/boost/fusion/view/single_view/detail/prior_impl.hpp index c34e481a..823f96e5 100644 --- a/include/boost/fusion/view/single_view/detail/prior_impl.hpp +++ b/include/boost/fusion/view/single_view/detail/prior_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion typename mpl::prior::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/single_view/single_view.hpp b/include/boost/fusion/view/single_view/single_view.hpp index 36c2c931..a4437902 100644 --- a/include/boost/fusion/view/single_view/single_view.hpp +++ b/include/boost/fusion/view/single_view/single_view.hpp @@ -43,18 +43,19 @@ namespace boost { namespace fusion typedef mpl::int_<1> size; typedef T value_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED single_view() : val() {} - BOOST_FUSION_GPU_ENABLED explicit single_view(typename detail::call_param::type in_val) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit single_view(typename detail::call_param::type in_val) : val(in_val) {} value_type val; }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline single_view::type> make_single_view(T const& v) { diff --git a/include/boost/fusion/view/single_view/single_view_iterator.hpp b/include/boost/fusion/view/single_view/single_view_iterator.hpp index 128c1cae..4ab620a5 100644 --- a/include/boost/fusion/view/single_view/single_view_iterator.hpp +++ b/include/boost/fusion/view/single_view/single_view_iterator.hpp @@ -40,7 +40,8 @@ namespace boost { namespace fusion typedef Pos position; typedef SingleView single_view_type; - BOOST_FUSION_GPU_ENABLED explicit single_view_iterator(single_view_type& in_view) + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + explicit single_view_iterator(single_view_type& in_view) : view(in_view) {} SingleView& view; diff --git a/include/boost/fusion/view/transform_view/detail/advance_impl.hpp b/include/boost/fusion/view/transform_view/detail/advance_impl.hpp index ae8a84ce..12dfabec 100644 --- a/include/boost/fusion/view/transform_view/detail/advance_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/advance_impl.hpp @@ -39,7 +39,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -62,7 +62,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/transform_view/detail/at_impl.hpp b/include/boost/fusion/view/transform_view/detail/at_impl.hpp index 5c6dd8fb..d2045bc2 100644 --- a/include/boost/fusion/view/transform_view/detail/at_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/at_impl.hpp @@ -33,7 +33,7 @@ namespace boost { namespace fusion { typedef typename boost::fusion::result_of::at::type value_type; typedef typename mpl::apply::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { return seq.f(boost::fusion::at(seq.seq)); @@ -53,7 +53,7 @@ namespace boost { namespace fusion { typedef typename boost::fusion::result_of::at::type value2_type; typedef typename mpl::apply::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { return seq.f(boost::fusion::at(seq.seq1), boost::fusion::at(seq.seq2)); diff --git a/include/boost/fusion/view/transform_view/detail/begin_impl.hpp b/include/boost/fusion/view/transform_view/detail/begin_impl.hpp index 7c40505a..da3f763a 100644 --- a/include/boost/fusion/view/transform_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/begin_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typedef typename Sequence::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { @@ -55,7 +55,7 @@ namespace boost { namespace fusion typedef typename Sequence::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/transform_view/detail/deref_impl.hpp b/include/boost/fusion/view/transform_view/detail/deref_impl.hpp index 35dacbd1..646da57c 100644 --- a/include/boost/fusion/view/transform_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/deref_impl.hpp @@ -37,7 +37,7 @@ namespace boost { namespace fusion typedef detail::apply_transform_result transform_type; typedef typename mpl::apply::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -63,7 +63,7 @@ namespace boost { namespace fusion typedef detail::apply_transform_result transform_type; typedef typename mpl::apply::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/transform_view/detail/distance_impl.hpp b/include/boost/fusion/view/transform_view/detail/distance_impl.hpp index ecbc8c5d..64443055 100644 --- a/include/boost/fusion/view/transform_view/detail/distance_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/distance_impl.hpp @@ -29,7 +29,7 @@ namespace boost { namespace fusion { struct apply : result_of::distance { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename result_of::distance::type call(First const& first, Last const& last) @@ -47,7 +47,7 @@ namespace boost { namespace fusion { struct apply : result_of::distance { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename result_of::distance::type call(First const& first, Last const& last) diff --git a/include/boost/fusion/view/transform_view/detail/end_impl.hpp b/include/boost/fusion/view/transform_view/detail/end_impl.hpp index 58e161b1..3a84e040 100644 --- a/include/boost/fusion/view/transform_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/end_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion typedef typename Sequence::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { @@ -55,7 +55,7 @@ namespace boost { namespace fusion typedef typename Sequence::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& s) { diff --git a/include/boost/fusion/view/transform_view/detail/next_impl.hpp b/include/boost/fusion/view/transform_view/detail/next_impl.hpp index cebba595..ce22d19e 100644 --- a/include/boost/fusion/view/transform_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/next_impl.hpp @@ -38,7 +38,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -61,7 +61,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/transform_view/detail/prior_impl.hpp b/include/boost/fusion/view/transform_view/detail/prior_impl.hpp index 19c802c6..ed6d742e 100644 --- a/include/boost/fusion/view/transform_view/detail/prior_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/prior_impl.hpp @@ -39,7 +39,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { @@ -62,7 +62,7 @@ namespace boost { namespace fusion typedef typename Iterator::transform_type transform_type; typedef transform_view_iterator2 type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& i) { diff --git a/include/boost/fusion/view/transform_view/transform_view.hpp b/include/boost/fusion/view/transform_view/transform_view.hpp index d18f49c6..4a6fc5b1 100644 --- a/include/boost/fusion/view/transform_view/transform_view.hpp +++ b/include/boost/fusion/view/transform_view/transform_view.hpp @@ -56,20 +56,20 @@ namespace boost { namespace fusion typedef Sequence2 sequence2_type; typedef F transform_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED transform_view(Sequence1& in_seq1, Sequence2& in_seq2, F const& binop) : f(binop) , seq1(in_seq1) , seq2(in_seq2) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first1_type first1() const { return fusion::begin(seq1); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first2_type first2() const { return fusion::begin(seq2); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last1_type last1() const { return fusion::end(seq1); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last2_type last2() const { return fusion::end(seq2); } transform_type f; @@ -100,15 +100,15 @@ namespace boost { namespace fusion typedef Sequence sequence_type; typedef F transform_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED transform_view(Sequence& in_seq, F const& in_f) : seq(in_seq) , f(in_f) {} - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last_type last() const { return fusion::end(seq); } typename mpl::if_, Sequence, Sequence&>::type seq; transform_type f; diff --git a/include/boost/fusion/view/transform_view/transform_view_iterator.hpp b/include/boost/fusion/view/transform_view/transform_view_iterator.hpp index 0762228f..1e56639e 100644 --- a/include/boost/fusion/view/transform_view/transform_view_iterator.hpp +++ b/include/boost/fusion/view/transform_view/transform_view_iterator.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion typedef typename traits::category_of::type category; typedef F transform_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED transform_view_iterator(First const& in_first, F const& in_f) : first(converter::call(in_first)), f(in_f) {} @@ -62,7 +62,7 @@ namespace boost { namespace fusion typedef typename traits::category_of::type category; typedef F transform_type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED transform_view_iterator2(First1 const& in_first1, First2 const& in_first2, F const& in_f) : first1(converter1::call(in_first1)), first2(converter2::call(in_first2)), f(in_f) {} diff --git a/include/boost/fusion/view/zip_view/detail/advance_impl.hpp b/include/boost/fusion/view/zip_view/detail/advance_impl.hpp index 17012ac8..69134d94 100644 --- a/include/boost/fusion/view/zip_view/detail/advance_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/advance_impl.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(const It& it) const { @@ -57,7 +57,7 @@ namespace boost { namespace fusion { typedef zip_view_iterator< typename result_of::transform >::type> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/zip_view/detail/at_impl.hpp b/include/boost/fusion/view/zip_view/detail/at_impl.hpp index f92c9817..55c0fef1 100644 --- a/include/boost/fusion/view/zip_view/detail/at_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/at_impl.hpp @@ -44,7 +44,7 @@ namespace boost { namespace fusion }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq& seq) const { @@ -52,14 +52,14 @@ namespace boost { namespace fusion } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq const& seq) const { return fusion::at(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -82,7 +82,7 @@ namespace boost { namespace fusion typename result_of::transform< typename Seq::sequences, detail::poly_at >::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Seq& seq) { diff --git a/include/boost/fusion/view/zip_view/detail/begin_impl.hpp b/include/boost/fusion/view/zip_view/detail/begin_impl.hpp index 32be2c7d..75e13751 100644 --- a/include/boost/fusion/view/zip_view/detail/begin_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/begin_impl.hpp @@ -41,7 +41,7 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq& seq) const { @@ -49,14 +49,14 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq const& seq) const { return fusion::begin(seq); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -79,7 +79,7 @@ namespace boost { namespace fusion { typename result_of::transform::type, typename Sequence::category> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& sequence) { diff --git a/include/boost/fusion/view/zip_view/detail/deref_impl.hpp b/include/boost/fusion/view/zip_view/detail/deref_impl.hpp index e9f091c3..df7e91ae 100644 --- a/include/boost/fusion/view/zip_view/detail/deref_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/deref_impl.hpp @@ -43,14 +43,14 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(const It& it) const { return fusion::deref(it); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -72,7 +72,7 @@ namespace boost { namespace fusion { typedef typename result_of::as_vector< typename result_of::transform::type>::type type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { diff --git a/include/boost/fusion/view/zip_view/detail/distance_impl.hpp b/include/boost/fusion/view/zip_view/detail/distance_impl.hpp index 8beaccca..f306e1b4 100644 --- a/include/boost/fusion/view/zip_view/detail/distance_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/distance_impl.hpp @@ -70,7 +70,7 @@ namespace boost { namespace fusion { struct apply : detail::zip_view_iterator_distance::type { - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static typename detail::zip_view_iterator_distance::type call(It1 const& /*it1*/, It2 const& /*it2*/) { diff --git a/include/boost/fusion/view/zip_view/detail/end_impl.hpp b/include/boost/fusion/view/zip_view/detail/end_impl.hpp index d57b08fb..28549cb7 100644 --- a/include/boost/fusion/view/zip_view/detail/end_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/end_impl.hpp @@ -55,7 +55,7 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq& seq) const { @@ -63,14 +63,14 @@ namespace boost { namespace fusion { } template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(Seq const& seq) const { return fusion::advance(fusion::begin(seq)); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -93,7 +93,7 @@ namespace boost { namespace fusion { typename result_of::transform >::type, typename Sequence::category> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Sequence& sequence) { diff --git a/include/boost/fusion/view/zip_view/detail/next_impl.hpp b/include/boost/fusion/view/zip_view/detail/next_impl.hpp index e9236b42..4bcd90a5 100644 --- a/include/boost/fusion/view/zip_view/detail/next_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/next_impl.hpp @@ -42,14 +42,14 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(const It& it) const { return fusion::next(it); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -72,7 +72,7 @@ namespace boost { namespace fusion { typename result_of::transform::type, typename Iterator::category> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) { diff --git a/include/boost/fusion/view/zip_view/detail/prior_impl.hpp b/include/boost/fusion/view/zip_view/detail/prior_impl.hpp index aa692295..655b5092 100644 --- a/include/boost/fusion/view/zip_view/detail/prior_impl.hpp +++ b/include/boost/fusion/view/zip_view/detail/prior_impl.hpp @@ -41,14 +41,14 @@ namespace boost { namespace fusion { }; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED typename result::type operator()(const It& it) const { return fusion::prior(it); } - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED unused_type operator()(unused_type const&) const { return unused_type(); @@ -71,7 +71,7 @@ namespace boost { namespace fusion { typename result_of::transform::type, typename Iterator::category> type; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(Iterator const& it) diff --git a/include/boost/fusion/view/zip_view/zip_view.hpp b/include/boost/fusion/view/zip_view/zip_view.hpp index 4e807f73..cf6f6d27 100644 --- a/include/boost/fusion/view/zip_view/zip_view.hpp +++ b/include/boost/fusion/view/zip_view/zip_view.hpp @@ -122,7 +122,7 @@ namespace boost { namespace fusion { typedef typename fusion::result_of::as_vector::type sequences; typedef typename detail::min_size::type size; - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED zip_view( const Sequences& seqs) : sequences_(seqs) diff --git a/include/boost/fusion/view/zip_view/zip_view_iterator.hpp b/include/boost/fusion/view/zip_view/zip_view_iterator.hpp index fec50e6f..49c2dc78 100644 --- a/include/boost/fusion/view/zip_view/zip_view_iterator.hpp +++ b/include/boost/fusion/view/zip_view/zip_view_iterator.hpp @@ -35,7 +35,7 @@ namespace boost { namespace fusion { typedef Traversal category; template - BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED zip_view_iterator( const InitSeq& iterator_seq) : iterators_(iterator_seq) diff --git a/preprocess/wave.cfg b/preprocess/wave.cfg index 3fd87116..b88198d7 100644 --- a/preprocess/wave.cfg +++ b/preprocess/wave.cfg @@ -8,10 +8,12 @@ -DBOOST_FUSION_CREATE_PREPROCESSED_FILES -D_WIN32 -D_M_IX86 +-NBOOST_CLANG -NBOOST_STATIC_ASSERT -NBOOST_FORCEINLINE -NBOOST_CONSTEXPR -NBOOST_CXX14_CONSTEXPR +-NBOOST_NOEXCEPT -NBOOST_NO_CXX11_RVALUE_REFERENCES -NBOOST_MPL_ASSERT -NBOOST_MPL_ASSERT_MSG