|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
-
-
-
-
-
-
-
-
-
-
-
-
-
- #ifndef RANGES_V3_UTILITY_MOVE_HPP
- #define RANGES_V3_UTILITY_MOVE_HPP
-
- #include <type_traits>
-
- #include <meta/meta.hpp>
-
- #include <range/v3/range_fwd.hpp>
-
- #include <range/v3/utility/static_const.hpp>
-
- namespace ranges
- {
- namespace aux
- {
-
- struct move_fn : move_tag
- {
- template<typename T>
- constexpr auto operator()(T && t) const noexcept
- -> meta::_t<std::remove_reference<T>> &&
- {
- return static_cast<meta::_t<std::remove_reference<T>> &&>(t);
- }
-
-
-
- template<typename T>
- friend constexpr decltype(auto) operator|(T && t, move_fn move) noexcept
- {
- return move(t);
- }
- };
-
-
-
- RANGES_INLINE_VARIABLE(move_fn, move)
-
-
-
- template<typename R>
- using move_t =
- meta::if_c<std::is_reference<R>::value, meta::_t<std::remove_reference<R>> &&,
- detail::decay_t<R>>;
- }
- }
-
- #endif
|