Horizon
Loading...
Searching...
No Matches
addressof.hpp
Go to the documentation of this file.
1
2// Range v3 library
3//
4// Copyright Andrey Diduh 2019
5//
6// Use, modification and distribution is subject to the
7// Boost Software License, Version 1.0. (See accompanying
8// file LICENSE_1_0.txt or copy at
9// http://www.boost.org/LICENSE_1_0.txt)
10//
11// Project home: https://github.com/ericniebler/range-v3
12//
13
14#ifndef RANGES_V3_VIEW_ADDRESSOF_HPP
15#define RANGES_V3_VIEW_ADDRESSOF_HPP
16
17#include <type_traits>
18#include <utility>
19
20#include <meta/meta.hpp>
21
22#include <range/v3/utility/addressof.hpp>
25
26#include <range/v3/detail/prologue.hpp>
27
28namespace ranges
29{
32 namespace views
33 {
35 {
36 private:
37 struct take_address
38 {
39 template<typename V>
40 constexpr V * operator()(V & value) const noexcept
41 {
42 return detail::addressof(value);
43 }
44 };
45
46 public:
47 template(typename Rng)(
49 std::is_lvalue_reference<range_reference_t<Rng>>::value) //
50 constexpr auto CPP_auto_fun(operator())(Rng && rng)(const) //
51 (
52 return transform(all(static_cast<Rng &&>(rng)), take_address{}) //
53 )
54 };
55
58 RANGES_INLINE_VARIABLE(view_closure<addressof_fn>, addressof)
59 } // namespace views
61} // namespace ranges
62
63#include <range/v3/detail/epilogue.hpp>
64
65#endif // RANGES_V3_VIEW_ADDRESSOF_HPP
The input_range concept.
The viewable_range concept.
Tiny meta-programming library.
Definition addressof.hpp:35
Definition view.hpp:178