forked from boostorg/fusion
[identity_view] Added boost::fusion::identity_view
This commit is contained in:
1 parent
c4e7f2bb1a
commit
aca00012d1
4 files changed
+70
-41
No files matched your search
@@ -10,41 +10,18 @@
|
||||
#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;
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4512) // assignment operator could not be generated.
|
||||
#endif
|
||||
namespace boost { namespace fusion {
|
||||
template<typename Sequence> struct identity_view
|
||||
: transform_view<Sequence, detail::identity>
|
||||
: transform_view<Sequence, boost::identity>
|
||||
{
|
||||
typedef transform_view<Sequence, detail::identity> base_type;
|
||||
typedef transform_view<Sequence, boost::identity> 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
|
||||
Reference in new issue
Block a user