Files

50 lines
1.4 KiB
C++
Raw Permalink Normal View History

2022-09-26 08:11:49 +08:00
/*=============================================================================
Copyright (c) 2022 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)
==============================================================================*/
#if !defined(BOOST_FUSION_IDENTITY_VIEW_HPP_INCLUDED)
#define BOOST_FUSION_IDENTITY_VIEW_HPP_INCLUDED
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/view/transform_view.hpp>
#include <boost/functional/identity.hpp>
2022-01-15 22:22:46 +04:00
#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;
};
}
2022-09-26 08:11:49 +08:00
2022-01-16 22:52:11 +03:00
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4512) // assignment operator could not be generated.
#endif
2022-09-26 08:11:49 +08:00
namespace boost { namespace fusion {
template<typename Sequence> struct identity_view
2022-01-15 22:22:46 +04:00
: transform_view<Sequence, detail::identity>
2022-09-26 08:11:49 +08:00
{
2022-01-15 22:22:46 +04:00
typedef transform_view<Sequence, detail::identity> base_type;
2022-09-26 08:11:49 +08:00
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
identity_view(Sequence& in_seq)
2022-01-15 22:22:46 +04:00
: base_type(in_seq, detail::identity()) {}
2022-09-26 08:11:49 +08:00
};
}}
2022-01-16 22:52:11 +03:00
#ifdef _MSC_VER
# pragma warning(pop)
#endif
2022-09-26 08:11:49 +08:00
#endif