From 41b38d4adc069c653e67bdf443ac2da5ca28d56c Mon Sep 17 00:00:00 2001 From: Denis Mikhailov Date: Sun, 9 Jan 2022 07:45:54 +0400 Subject: [PATCH 01/10] Update view.qbk --- doc/view.qbk | 58 ---------------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/doc/view.qbk b/doc/view.qbk index a3ad4d09..e65ac630 100644 --- a/doc/view.qbk +++ b/doc/view.qbk @@ -1,7 +1,6 @@ [/============================================================================== Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2006 Dan Marsden - Copyright (c) 2022 Denis Mikhailov Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -364,7 +363,6 @@ given a binary function object or function pointer. * __forward_sequence__, __bidirectional_sequence__ or __random_access_sequence__ depending on the traversal characteristics (see __traversal_concept__) of its underlying sequence or sequences. -* __associative_sequence__ if underlying sequence implements the __associative_sequence__ model(available only with unary version of `transform_view`). [variablelist Notation [[`TV`] [A `transform_view` type]] @@ -665,60 +663,4 @@ defined in __forward_sequence__. [endsect] -[section identity_view] - -[heading Description] - -`identity_view` presents underlying sequence unchanged. - -[heading Header] - - #include - #include - -[heading Synopsis] - - template - struct identity_view; - -[heading Template parameters] - -[table - [[Parameter] [Description] [Default]] - [[`Sequence`] [A __forward_sequence__] []] -] - -[heading Model of] - -* A model of __forward_sequence__ if `Sequence` is a __forward_sequence__ else, __bidirectional_sequence__ if `Sequence` is a __bidirectional_sequence__ -else, __random_access_sequence__ if `Sequence` is a __random_access_sequence__. -* __associative_sequence__ if `Sequence` implements the __associative_sequence__ model. - -[variablelist Notation - [[`IV`] [An `identity_view` type]] - [[`s`] [An instance of `Sequence`]] - [[`iv`, `iv2`] [Instances of `identity_view`]] -] - -[heading Expression Semantics] - -Semantics of an expression is defined only where it differs from, or is not -defined in the implemented models. - -[table - [[Expression] [Semantics]] - [[`IV(s)`] [Creates an `identity_view` given sequence, `s`.]] - [[`IV(iv)`] [Copy constructs an `identity_view` from another `identity_view`, `iv`.]] - [[`iv = iv2`] [Assigns to an `identity_view`, `iv`, from another `identity_view`, `iv2`.]] -] - -[heading Example] - typedef __vector__ vector_type; - vector_type vec(2, 5, 3.3); - - __identity_view__ identity(vec); - std::cout << identity << std::endl; // (2 5 3.3) - -[endsect] - [endsect] From 516a7a7add10266cc850eecd527bf15a667cd36c Mon Sep 17 00:00:00 2001 From: Denis Mikhailov Date: Fri, 5 Nov 2021 14:13:09 +0400 Subject: [PATCH 02/10] Update appveyor.yml --- appveyor.yml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index debd336b..cc1d3dce 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,21 +10,8 @@ shallow_clone: true environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: msvc-9.0 + TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0 ADDRMD: 32 - CXXSTD: latest # fake - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: msvc-10.0 - ADDRMD: 32 - CXXSTD: latest # fake - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: msvc-11.0 - ADDRMD: 32 - CXXSTD: latest # fake - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: msvc-12.0 - ADDRMD: 32 - CXXSTD: latest # fake - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 TOOLSET: msvc-14.0 CXXSTD: 14 @@ -92,5 +79,4 @@ install: build: off test_script: - - if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% - - b2 -j%NUMBER_OF_PROCESSORS% --hash libs/fusion/test toolset=%TOOLSET% cxxstd=%CXXSTD% %ADDRMD% + - b2 -j%NUMBER_OF_PROCESSORS% --hash libs/fusion/test toolset=%TOOLSET% cxxstd=%CXXSTD% From cf99c661767998a96ae25f3e37e80e4999bc0aff Mon Sep 17 00:00:00 2001 From: Denis Mikhailov Date: Fri, 5 Nov 2021 14:51:22 +0400 Subject: [PATCH 03/10] Update appveyor.yml --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index cc1d3dce..53192e2e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -79,4 +79,5 @@ install: build: off test_script: - - b2 -j%NUMBER_OF_PROCESSORS% --hash libs/fusion/test toolset=%TOOLSET% cxxstd=%CXXSTD% + - if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD% + - b2 -j%NUMBER_OF_PROCESSORS% --hash libs/fusion/test toolset=%TOOLSET% cxxstd=%CXXSTD% %ADDRMD% From 638855c861b32bb439b5f19f4580fb7526e5a47f Mon Sep 17 00:00:00 2001 From: Denis Mikhailov Date: Fri, 5 Nov 2021 15:39:10 +0400 Subject: [PATCH 04/10] Update appveyor.yml --- appveyor.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 53192e2e..debd336b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,8 +10,21 @@ shallow_clone: true environment: matrix: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0 + TOOLSET: msvc-9.0 ADDRMD: 32 + CXXSTD: latest # fake + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + TOOLSET: msvc-10.0 + ADDRMD: 32 + CXXSTD: latest # fake + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + TOOLSET: msvc-11.0 + ADDRMD: 32 + CXXSTD: latest # fake + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + TOOLSET: msvc-12.0 + ADDRMD: 32 + CXXSTD: latest # fake - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 TOOLSET: msvc-14.0 CXXSTD: 14 From c16e4f046b48644adfe7c08d7aae22ffc0c39069 Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sat, 6 Nov 2021 20:09:19 +0400 Subject: [PATCH 05/10] [transform_view_ext] Updated docs --- doc/sequence.qbk | 4 --- doc/view.qbk | 65 +++--------------------------------------------- 2 files changed, 4 insertions(+), 65 deletions(-) diff --git a/doc/sequence.qbk b/doc/sequence.qbk index 554d951f..b193b8e9 100644 --- a/doc/sequence.qbk +++ b/doc/sequence.qbk @@ -133,7 +133,6 @@ For any Forward Sequence s the following invariants always hold: * __transform_view__ * __reverse_view__ * __zip_view__ -* __identity_view__ [endsect] @@ -202,7 +201,6 @@ are not defined in __forward_sequence__. * __iterator_range__ (where adapted sequence is a Bidirectional Sequence) * __transform_view__ (where adapted sequence is a Bidirectional Sequence) * __zip_view__ (where adapted sequences are models of Bidirectional Sequence) -* __identity_view__ (where adapted sequence is a Bidirectional Sequence) [endsect] @@ -291,7 +289,6 @@ are not defined in __bidirectional_sequence__. * __iterator_range__ (where adapted sequence is a Random Access Sequence) * __transform_view__ (where adapted sequence is a Random Access Sequence) * __zip_view__ (where adapted sequences are models of Random Access Sequence) -* __identity_view__ (where adapted sequence is a Random Access Sequence) [endsect] @@ -364,7 +361,6 @@ you can use `__result_of_value_at_key__`.] * __joint_view__ (where adapted sequences are __associative_sequence__\ s and __forward_sequence__\ s) * __reverse_view__ (where adapted sequence is an __associative_sequence__ and a __bidirectional_sequence__) * __transform_view__ (where adapted sequence is an __associative_sequence__ and a __forward_sequence__) -* __identity_view__ (where adapted sequence is an __associative_sequence__ and a __forward_sequence__) [endsect] diff --git a/doc/view.qbk b/doc/view.qbk index a3ad4d09..6caa33fc 100644 --- a/doc/view.qbk +++ b/doc/view.qbk @@ -1,7 +1,6 @@ [/============================================================================== Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2006 Dan Marsden - Copyright (c) 2022 Denis Mikhailov Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -361,10 +360,10 @@ given a binary function object or function pointer. [heading Model of] -* __forward_sequence__, __bidirectional_sequence__ or -__random_access_sequence__ depending on the traversal characteristics (see -__traversal_concept__) of its underlying sequence or sequences. -* __associative_sequence__ if underlying sequence implements the __associative_sequence__ model(available only with unary version of `transform_view`). +* A model of __forward_sequence__ if `Sequence` is a __forward_sequence__ +else, __bidirectional_sequence__ if `Sequence` is a __bidirectional_sequence__ +else, __random_access_sequence__ if `Sequence` is a __random_access_sequence__. +* __associative_sequence__ if `Sequence` implements the __associative_sequence__ model. [variablelist Notation [[`TV`] [A `transform_view` type]] @@ -665,60 +664,4 @@ defined in __forward_sequence__. [endsect] -[section identity_view] - -[heading Description] - -`identity_view` presents underlying sequence unchanged. - -[heading Header] - - #include - #include - -[heading Synopsis] - - template - struct identity_view; - -[heading Template parameters] - -[table - [[Parameter] [Description] [Default]] - [[`Sequence`] [A __forward_sequence__] []] -] - -[heading Model of] - -* A model of __forward_sequence__ if `Sequence` is a __forward_sequence__ else, __bidirectional_sequence__ if `Sequence` is a __bidirectional_sequence__ -else, __random_access_sequence__ if `Sequence` is a __random_access_sequence__. -* __associative_sequence__ if `Sequence` implements the __associative_sequence__ model. - -[variablelist Notation - [[`IV`] [An `identity_view` type]] - [[`s`] [An instance of `Sequence`]] - [[`iv`, `iv2`] [Instances of `identity_view`]] -] - -[heading Expression Semantics] - -Semantics of an expression is defined only where it differs from, or is not -defined in the implemented models. - -[table - [[Expression] [Semantics]] - [[`IV(s)`] [Creates an `identity_view` given sequence, `s`.]] - [[`IV(iv)`] [Copy constructs an `identity_view` from another `identity_view`, `iv`.]] - [[`iv = iv2`] [Assigns to an `identity_view`, `iv`, from another `identity_view`, `iv2`.]] -] - -[heading Example] - typedef __vector__ vector_type; - vector_type vec(2, 5, 3.3); - - __identity_view__ identity(vec); - std::cout << identity << std::endl; // (2 5 3.3) - -[endsect] - [endsect] From 360dd957f279b08c90c90e43a7222eaad685d26c Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sun, 9 Jan 2022 16:34:07 +0400 Subject: [PATCH 06/10] [transform_view_ext] Unary transform_view is an Associative Sequence now --- doc/view.qbk | 1 + .../transform_view/detail/deref_data_impl.hpp | 5 ----- .../transform_view/transform_view_iterator.hpp | 15 ++++++--------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/doc/view.qbk b/doc/view.qbk index e65ac630..d99b325f 100644 --- a/doc/view.qbk +++ b/doc/view.qbk @@ -363,6 +363,7 @@ given a binary function object or function pointer. * __forward_sequence__, __bidirectional_sequence__ or __random_access_sequence__ depending on the traversal characteristics (see __traversal_concept__) of its underlying sequence or sequences. +* __associative_sequence__ if underlying sequence implements the __associative_sequence__ model(available only with unary version of `transform_view`). [variablelist Notation [[`TV`] [A `transform_view` type]] diff --git a/include/boost/fusion/view/transform_view/detail/deref_data_impl.hpp b/include/boost/fusion/view/transform_view/detail/deref_data_impl.hpp index 83ea236a..3eb325a4 100644 --- a/include/boost/fusion/view/transform_view/detail/deref_data_impl.hpp +++ b/include/boost/fusion/view/transform_view/detail/deref_data_impl.hpp @@ -10,11 +10,6 @@ #include #include #include -#include -#include -#include -#include -#include namespace boost { namespace fusion { 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 ba5b7c9b..071cba8e 100644 --- a/include/boost/fusion/view/transform_view/transform_view_iterator.hpp +++ b/include/boost/fusion/view/transform_view/transform_view_iterator.hpp @@ -23,11 +23,6 @@ #include #include -#ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable: 4512) // assignment operator could not be generated. -#endif - namespace boost { namespace fusion { // Unary Version @@ -49,6 +44,9 @@ namespace boost { namespace fusion first_type first; transform_type f; + + // silence MSVC warning C4512: assignment operator could not be generated + BOOST_DELETED_FUNCTION(transform_view_iterator& operator= (transform_view_iterator const&)) }; // Binary Version @@ -73,13 +71,12 @@ namespace boost { namespace fusion first1_type first1; first2_type first2; transform_type f; + + // silence MSVC warning C4512: assignment operator could not be generated + BOOST_DELETED_FUNCTION(transform_view_iterator2& operator= (transform_view_iterator2 const&)) }; }} -#ifdef _MSC_VER -# pragma warning(pop) -#endif - #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408 namespace std { From 596056930a8639431f4bfb5c56286e9d42f1f86e Mon Sep 17 00:00:00 2001 From: denzor200 Date: Mon, 10 Jan 2022 21:19:38 +0400 Subject: [PATCH 07/10] [identity_view] Added boost::fusion::identity_view --- doc/sequence.qbk | 4 ++ doc/view.qbk | 57 +++++++++++++++++++ .../view/identity_view/identity_view.hpp | 31 ++-------- test/sequence/identity_view.cpp | 19 ++----- 4 files changed, 70 insertions(+), 41 deletions(-) diff --git a/doc/sequence.qbk b/doc/sequence.qbk index b193b8e9..554d951f 100644 --- a/doc/sequence.qbk +++ b/doc/sequence.qbk @@ -133,6 +133,7 @@ For any Forward Sequence s the following invariants always hold: * __transform_view__ * __reverse_view__ * __zip_view__ +* __identity_view__ [endsect] @@ -201,6 +202,7 @@ are not defined in __forward_sequence__. * __iterator_range__ (where adapted sequence is a Bidirectional Sequence) * __transform_view__ (where adapted sequence is a Bidirectional Sequence) * __zip_view__ (where adapted sequences are models of Bidirectional Sequence) +* __identity_view__ (where adapted sequence is a Bidirectional Sequence) [endsect] @@ -289,6 +291,7 @@ are not defined in __bidirectional_sequence__. * __iterator_range__ (where adapted sequence is a Random Access Sequence) * __transform_view__ (where adapted sequence is a Random Access Sequence) * __zip_view__ (where adapted sequences are models of Random Access Sequence) +* __identity_view__ (where adapted sequence is a Random Access Sequence) [endsect] @@ -361,6 +364,7 @@ you can use `__result_of_value_at_key__`.] * __joint_view__ (where adapted sequences are __associative_sequence__\ s and __forward_sequence__\ s) * __reverse_view__ (where adapted sequence is an __associative_sequence__ and a __bidirectional_sequence__) * __transform_view__ (where adapted sequence is an __associative_sequence__ and a __forward_sequence__) +* __identity_view__ (where adapted sequence is an __associative_sequence__ and a __forward_sequence__) [endsect] diff --git a/doc/view.qbk b/doc/view.qbk index d99b325f..a3ad4d09 100644 --- a/doc/view.qbk +++ b/doc/view.qbk @@ -1,6 +1,7 @@ [/============================================================================== Copyright (C) 2001-2011 Joel de Guzman Copyright (C) 2006 Dan Marsden + Copyright (c) 2022 Denis Mikhailov Use, modification and distribution is subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -664,4 +665,60 @@ defined in __forward_sequence__. [endsect] +[section identity_view] + +[heading Description] + +`identity_view` presents underlying sequence unchanged. + +[heading Header] + + #include + #include + +[heading Synopsis] + + template + struct identity_view; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Sequence`] [A __forward_sequence__] []] +] + +[heading Model of] + +* A model of __forward_sequence__ if `Sequence` is a __forward_sequence__ else, __bidirectional_sequence__ if `Sequence` is a __bidirectional_sequence__ +else, __random_access_sequence__ if `Sequence` is a __random_access_sequence__. +* __associative_sequence__ if `Sequence` implements the __associative_sequence__ model. + +[variablelist Notation + [[`IV`] [An `identity_view` type]] + [[`s`] [An instance of `Sequence`]] + [[`iv`, `iv2`] [Instances of `identity_view`]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in the implemented models. + +[table + [[Expression] [Semantics]] + [[`IV(s)`] [Creates an `identity_view` given sequence, `s`.]] + [[`IV(iv)`] [Copy constructs an `identity_view` from another `identity_view`, `iv`.]] + [[`iv = iv2`] [Assigns to an `identity_view`, `iv`, from another `identity_view`, `iv2`.]] +] + +[heading Example] + typedef __vector__ vector_type; + vector_type vec(2, 5, 3.3); + + __identity_view__ identity(vec); + std::cout << identity << std::endl; // (2 5 3.3) + +[endsect] + [endsect] diff --git a/include/boost/fusion/view/identity_view/identity_view.hpp b/include/boost/fusion/view/identity_view/identity_view.hpp index 4cd0c093..f26f2bc7 100644 --- a/include/boost/fusion/view/identity_view/identity_view.hpp +++ b/include/boost/fusion/view/identity_view/identity_view.hpp @@ -10,41 +10,18 @@ #include #include #include -#include -namespace boost { namespace fusion { - namespace detail { - struct identity : boost::identity - { - }; - } -}} - -namespace boost { - template - struct result_of - { - typedef T type; - }; -} - -#ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable: 4512) // assignment operator could not be generated. -#endif namespace boost { namespace fusion { template struct identity_view - : transform_view + : transform_view { - typedef transform_view base_type; + typedef transform_view base_type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED identity_view(Sequence& in_seq) - : base_type(in_seq, detail::identity()) {} + : base_type(in_seq, boost::identity()) {} }; + }} -#ifdef _MSC_VER -# pragma warning(pop) -#endif #endif diff --git a/test/sequence/identity_view.cpp b/test/sequence/identity_view.cpp index e74f9294..285b17e2 100644 --- a/test/sequence/identity_view.cpp +++ b/test/sequence/identity_view.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -77,16 +76,7 @@ main() BOOST_TEST((*boost::fusion::advance_c<3>(boost::fusion::begin(xform)) == 8)); BOOST_TEST((boost::fusion::at_c<2>(xform) == 7)); - BOOST_MPL_ASSERT((boost::is_same::type, boost::mpl::integral_c >)); - } - - { - typedef vector sequence_type; - sequence_type seq; - identity_view ident(seq); - copy(make_vector(1, 2, 3, 4, 5), ident); - std::cout << seq << std::endl; - BOOST_TEST((seq == make_vector(1, 2, 3, 4, 5))); + BOOST_MPL_ASSERT((boost::is_same::type, boost::mpl::integral_c&& >)); } /// Associative @@ -153,9 +143,10 @@ main() typedef boost::fusion::result_of::next::type second; typedef boost::fusion::result_of::next::type third; - BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair >)); - BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair >)); - BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair >)); + // TODO: why is a boost::fusion::pair&& ?? + BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair&& >)); + BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair&& >)); + BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair&& >)); } { From 62b45086c0f354323b4c7c049cb6a9053da420c8 Mon Sep 17 00:00:00 2001 From: Denis Mikhailov Date: Wed, 12 Jan 2022 09:48:26 +0400 Subject: [PATCH 08/10] Update identity_view.cpp --- test/sequence/identity_view.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/sequence/identity_view.cpp b/test/sequence/identity_view.cpp index 285b17e2..0ad33277 100644 --- a/test/sequence/identity_view.cpp +++ b/test/sequence/identity_view.cpp @@ -79,6 +79,15 @@ main() BOOST_MPL_ASSERT((boost::is_same::type, boost::mpl::integral_c&& >)); } + { + typedef vector sequence_type; + sequence_type seq; + identity_view ident(seq); + copy(make_vector(1, 2, 3, 4, 5), ident); + std::cout << seq << std::endl; + BOOST_TEST((seq == make_vector(1, 2, 3, 4, 5))); + } + /// Associative { typedef map< From 11abd9b15634227d7a75182cbaf3336b39a71180 Mon Sep 17 00:00:00 2001 From: Denis Mikhailov Date: Wed, 12 Jan 2022 10:14:07 +0400 Subject: [PATCH 09/10] Update identity_view.cpp --- test/sequence/identity_view.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/sequence/identity_view.cpp b/test/sequence/identity_view.cpp index 0ad33277..1f8c3de2 100644 --- a/test/sequence/identity_view.cpp +++ b/test/sequence/identity_view.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include From c59c1790c3b5e98df2646d0dfc9431666415a49f Mon Sep 17 00:00:00 2001 From: denzor200 Date: Sat, 15 Jan 2022 22:22:46 +0400 Subject: [PATCH 10/10] [identity_view] Fix for spoiled prvalue --- .../view/identity_view/identity_view.hpp | 24 +++++++++++++++---- test/sequence/identity_view.cpp | 9 ++++--- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/include/boost/fusion/view/identity_view/identity_view.hpp b/include/boost/fusion/view/identity_view/identity_view.hpp index f26f2bc7..e7efdb7a 100644 --- a/include/boost/fusion/view/identity_view/identity_view.hpp +++ b/include/boost/fusion/view/identity_view/identity_view.hpp @@ -10,18 +10,34 @@ #include #include #include +#include + +namespace boost { namespace fusion { + namespace detail { + struct identity : boost::identity + { + }; + } +}} + +namespace boost { + template + struct result_of + { + typedef T type; + }; +} namespace boost { namespace fusion { template struct identity_view - : transform_view + : transform_view { - typedef transform_view base_type; + typedef transform_view base_type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED identity_view(Sequence& in_seq) - : base_type(in_seq, boost::identity()) {} + : base_type(in_seq, detail::identity()) {} }; - }} #endif diff --git a/test/sequence/identity_view.cpp b/test/sequence/identity_view.cpp index 1f8c3de2..e74f9294 100644 --- a/test/sequence/identity_view.cpp +++ b/test/sequence/identity_view.cpp @@ -77,7 +77,7 @@ main() BOOST_TEST((*boost::fusion::advance_c<3>(boost::fusion::begin(xform)) == 8)); BOOST_TEST((boost::fusion::at_c<2>(xform) == 7)); - BOOST_MPL_ASSERT((boost::is_same::type, boost::mpl::integral_c&& >)); + BOOST_MPL_ASSERT((boost::is_same::type, boost::mpl::integral_c >)); } { @@ -153,10 +153,9 @@ main() typedef boost::fusion::result_of::next::type second; typedef boost::fusion::result_of::next::type third; - // TODO: why is a boost::fusion::pair&& ?? - BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair&& >)); - BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair&& >)); - BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair&& >)); + BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair >)); + BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair >)); + BOOST_MPL_ASSERT((boost::is_same::type, boost::fusion::pair >)); } {