From f07cca743ff2f5d8294b68a8e2c36d6229c5499f Mon Sep 17 00:00:00 2001 From: Denis Mikhailov Date: Sun, 7 Nov 2021 03:03:18 +0400 Subject: [PATCH 1/5] Update reverse_view.cpp --- test/sequence/reverse_view.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/sequence/reverse_view.cpp b/test/sequence/reverse_view.cpp index fb96275d..4e6688f5 100644 --- a/test/sequence/reverse_view.cpp +++ b/test/sequence/reverse_view.cpp @@ -102,6 +102,21 @@ main() BOOST_TEST((at_c<2>(rev) == pair2("two"))); BOOST_TEST((at_c<3>(rev) == pair1("one"))); BOOST_TEST((at_c<4>(rev) == pair0("zero"))); + BOOST_TEST(( has_key< boost::mpl::int_<0> >(rev) + && has_key< boost::mpl::int_<4> >(rev) + && !has_key< boost::mpl::int_<-1> >(rev) + && !has_key< boost::mpl::int_<5> >(rev) )); + BOOST_TEST((at_key< boost::mpl::int_<0> >(rev) == "zero")); + BOOST_TEST((at_key< boost::mpl::int_<1> >(rev) == "one")); + BOOST_TEST((at_key< boost::mpl::int_<2> >(rev) == "two")); + BOOST_TEST((at_key< boost::mpl::int_<3> >(rev) == "three")); + BOOST_TEST((at_key< boost::mpl::int_<4> >(rev) == "four")); + BOOST_TEST(( (at_key< boost::mpl::int_<0> >(rev) = "new_zero") == "new_zero" + && at_key< boost::mpl::int_<0> >(rev) == "new_zero" )); + BOOST_MPL_ASSERT((boost::mpl::and_ > + , boost::mpl::not_ > > >)); + BOOST_MPL_ASSERT((boost::is_same>::type, std::string&>)); + BOOST_MPL_ASSERT((boost::is_same >::type, std::string>)); } return boost::report_errors(); From 380a2bc7a04e022e590d6b80f4db3c8dd6a2c401 Mon Sep 17 00:00:00 2001 From: Denis Mikhailov Date: Sun, 7 Nov 2021 03:29:06 +0400 Subject: [PATCH 2/5] Update reverse_view.cpp --- test/sequence/reverse_view.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/sequence/reverse_view.cpp b/test/sequence/reverse_view.cpp index 4e6688f5..2b587a21 100644 --- a/test/sequence/reverse_view.cpp +++ b/test/sequence/reverse_view.cpp @@ -15,6 +15,9 @@ #include #include #include +#include +#include +#include #include #include #include From 95cf8bdb8dba61a9eda579a66acec40c0c885577 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sun, 7 Nov 2021 23:07:18 +0400 Subject: [PATCH 3/5] Applied fixes for reverse_view --- .../reverse_view/detail/deref_data_impl.hpp | 21 ++++--------------- .../view/reverse_view/detail/key_of_impl.hpp | 13 ++++++++++-- .../detail/value_of_data_impl.hpp | 4 +++- test/sequence/reverse_view.cpp | 1 + 4 files changed, 19 insertions(+), 20 deletions(-) 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 e93b8fba..dc995dde 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 @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2009 Christopher Schmidt + Copyright (c) 2021 Denis Mikhailov 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) @@ -9,7 +10,7 @@ #define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP #include -#include +#include namespace boost { namespace fusion { namespace extension { @@ -18,22 +19,8 @@ namespace boost { namespace fusion { namespace extension template <> struct deref_data_impl - { - template - struct apply - { - typedef typename - result_of::deref_data::type - type; - - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - static type - call(It const& it) - { - return fusion::deref_data(it.first); - } - }; - }; + : deref_impl + {}; }}} #endif diff --git a/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp b/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp index 985e5fa9..a2d8daef 100644 --- a/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2009 Christopher Schmidt + Copyright (c) 2021 Denis Mikhailov 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) @@ -10,6 +11,7 @@ #include #include +#include namespace boost { namespace fusion { namespace extension { @@ -21,8 +23,15 @@ namespace boost { namespace fusion { namespace extension { template struct apply - : result_of::key_of - {}; + { + typedef typename + result_of::key_of< + typename result_of::prior< + typename It::first_type + >::type + >::type + type; + }; }; }}} diff --git a/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp b/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp index a96d1ce3..d4b728de 100644 --- a/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2009 Christopher Schmidt + Copyright (c) 2021 Denis Mikhailov 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) @@ -10,6 +11,7 @@ #include #include +#include namespace boost { namespace fusion { namespace extension { @@ -21,7 +23,7 @@ namespace boost { namespace fusion { namespace extension { template struct apply - : result_of::value_of_data + : value_of_impl {}; }; }}} diff --git a/test/sequence/reverse_view.cpp b/test/sequence/reverse_view.cpp index 2b587a21..b6afac99 100644 --- a/test/sequence/reverse_view.cpp +++ b/test/sequence/reverse_view.cpp @@ -1,5 +1,6 @@ /*============================================================================= Copyright (c) 2001-2011 Joel de Guzman + Copyright (c) 2021 Denis Mikhailov 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) From 2bb8a26c5b951ef6186a96cedf4341314b5c6a86 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Mon, 8 Nov 2021 02:11:31 +0400 Subject: [PATCH 4/5] Fixed all '*_data' methods in reverse_view --- .../reverse_view/detail/deref_data_impl.hpp | 25 ++++++++++++++++--- .../detail/value_of_data_impl.hpp | 15 ++++++++--- 2 files changed, 33 insertions(+), 7 deletions(-) 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 dc995dde..e9bb9a02 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 @@ -10,7 +10,8 @@ #define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP #include -#include +#include +#include namespace boost { namespace fusion { namespace extension { @@ -19,8 +20,26 @@ namespace boost { namespace fusion { namespace extension template <> struct deref_data_impl - : deref_impl - {}; + { + template + struct apply + { + typedef typename + result_of::deref_data< + typename result_of::prior< + typename Iterator::first_type + >::type + >::type + type; + + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED + static type + call(Iterator const& i) + { + return fusion::deref_data(fusion::prior(i.first)); + } + }; + }; }}} #endif diff --git a/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp b/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp index d4b728de..c657f9e0 100644 --- a/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp @@ -11,7 +11,7 @@ #include #include -#include +#include namespace boost { namespace fusion { namespace extension { @@ -21,10 +21,17 @@ namespace boost { namespace fusion { namespace extension template <> struct value_of_data_impl { - template + template struct apply - : value_of_impl - {}; + { + typedef typename + result_of::value_of_data< + typename result_of::prior< + typename Iterator::first_type + >::type + >::type + type; + }; }; }}} From d22982e3a9f780a924d331fe5f87e125d9e69c8e Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sun, 16 Jan 2022 09:49:05 +0400 Subject: [PATCH 5/5] Diff simplified && update copyrights --- .../view/reverse_view/detail/deref_data_impl.hpp | 10 +++++----- .../fusion/view/reverse_view/detail/key_of_impl.hpp | 2 +- .../view/reverse_view/detail/value_of_data_impl.hpp | 6 +++--- test/sequence/reverse_view.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) 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 e9bb9a02..db64d32b 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 @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 2009 Christopher Schmidt - Copyright (c) 2021 Denis Mikhailov + Copyright (c) 2021-2022 Denis Mikhailov 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) @@ -21,22 +21,22 @@ namespace boost { namespace fusion { namespace extension template <> struct deref_data_impl { - template + template struct apply { typedef typename result_of::deref_data< typename result_of::prior< - typename Iterator::first_type + typename It::first_type >::type >::type type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type - call(Iterator const& i) + call(It const& it) { - return fusion::deref_data(fusion::prior(i.first)); + return fusion::deref_data(fusion::prior(it.first)); } }; }; diff --git a/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp b/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp index a2d8daef..0b8fc3bc 100644 --- a/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 2009 Christopher Schmidt - Copyright (c) 2021 Denis Mikhailov + Copyright (c) 2021-2022 Denis Mikhailov 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) diff --git a/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp b/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp index c657f9e0..03cb753f 100644 --- a/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp +++ b/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 2009 Christopher Schmidt - Copyright (c) 2021 Denis Mikhailov + Copyright (c) 2021-2022 Denis Mikhailov 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) @@ -21,13 +21,13 @@ namespace boost { namespace fusion { namespace extension template <> struct value_of_data_impl { - template + template struct apply { typedef typename result_of::value_of_data< typename result_of::prior< - typename Iterator::first_type + typename It::first_type >::type >::type type; diff --git a/test/sequence/reverse_view.cpp b/test/sequence/reverse_view.cpp index b6afac99..aded1522 100644 --- a/test/sequence/reverse_view.cpp +++ b/test/sequence/reverse_view.cpp @@ -1,6 +1,6 @@ /*============================================================================= Copyright (c) 2001-2011 Joel de Guzman - Copyright (c) 2021 Denis Mikhailov + Copyright (c) 2021-2022 Denis Mikhailov 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)