[identity_view] Fix for spoiled prvalue

This commit is contained in:
denzor200
2022-01-15 22:22:46 +04:00
parent d26c2e4212
commit 21a449ae46
2 changed files with 24 additions and 9 deletions
@@ -10,18 +10,34 @@
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/view/transform_view.hpp>
#include <boost/functional/identity.hpp>
#include <boost/utility/result_of.hpp>
namespace boost { namespace fusion {
namespace detail {
struct identity : boost::identity
{
};
}
}}
namespace boost {
template<typename T>
struct result_of<fusion::detail::identity(T)>
{
typedef T type;
};
}
namespace boost { namespace fusion {
template<typename Sequence> struct identity_view
: transform_view<Sequence, boost::identity>
: transform_view<Sequence, detail::identity>
{
typedef transform_view<Sequence, boost::identity> base_type;
typedef transform_view<Sequence, detail::identity> 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