File indexing completed on 2024-11-16 09:54:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef RANGES_V3_UTILITY_COPY_HPP
0015 #define RANGES_V3_UTILITY_COPY_HPP
0016
0017 #include <concepts/concepts.hpp>
0018
0019 #include <range/v3/range_fwd.hpp>
0020
0021 #include <range/v3/utility/static_const.hpp>
0022
0023 #include <range/v3/detail/prologue.hpp>
0024
0025 namespace ranges
0026 {
0027
0028
0029 namespace aux
0030 {
0031 struct copy_fn : copy_tag
0032 {
0033 template(typename T)(
0034 requires constructible_from<detail::decay_t<T>, T>)
0035 constexpr auto operator()(T && t) const -> detail::decay_t<T>
0036 {
0037 return static_cast<T &&>(t);
0038 }
0039
0040
0041
0042 template<typename T>
0043 friend constexpr auto operator|(T && t, copy_fn)
0044 -> CPP_broken_friend_ret(detail::decay_t<T>)(
0045 requires constructible_from<detail::decay_t<T>, T>)
0046 {
0047 return static_cast<T &&>(t);
0048 }
0049 };
0050
0051
0052
0053 RANGES_INLINE_VARIABLE(copy_fn, copy)
0054 }
0055
0056 }
0057
0058 #include <range/v3/detail/epilogue.hpp>
0059
0060 #endif