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 >)); } {