From 95cf8bdb8dba61a9eda579a66acec40c0c885577 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sun, 7 Nov 2021 23:07:18 +0400 Subject: [PATCH] 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)