File indexing completed on 2025-01-18 10:09:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef RANGES_V3_VIEW_ADDRESSOF_HPP
0015 #define RANGES_V3_VIEW_ADDRESSOF_HPP
0016
0017 #include <type_traits>
0018 #include <utility>
0019
0020 #include <meta/meta.hpp>
0021
0022 #include <range/v3/utility/addressof.hpp>
0023 #include <range/v3/view/transform.hpp>
0024 #include <range/v3/view/view.hpp>
0025
0026 #include <range/v3/detail/prologue.hpp>
0027
0028 namespace ranges
0029 {
0030
0031
0032 namespace views
0033 {
0034 struct addressof_fn
0035 {
0036 private:
0037 struct take_address
0038 {
0039 template<typename V>
0040 constexpr V * operator()(V & value) const noexcept
0041 {
0042 return detail::addressof(value);
0043 }
0044 };
0045
0046 public:
0047 template(typename Rng)(
0048 requires viewable_range<Rng> AND input_range<Rng> AND
0049 std::is_lvalue_reference<range_reference_t<Rng>>::value)
0050 constexpr auto CPP_auto_fun(operator())(Rng && rng)(const)
0051 (
0052 return transform(all(static_cast<Rng &&>(rng)), take_address{})
0053 )
0054 };
0055
0056
0057
0058 RANGES_INLINE_VARIABLE(view_closure<addressof_fn>, addressof)
0059 }
0060
0061 }
0062
0063 #include <range/v3/detail/epilogue.hpp>
0064
0065 #endif