tmp/tmpn7uqsjtr/{from.md → to.md}
RENAMED
|
@@ -1,20 +1,19 @@
|
|
| 1 |
#### Class template `ref_view` <a id="range.ref.view">[[range.ref.view]]</a>
|
| 2 |
|
| 3 |
-
`ref_view` is a
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
namespace std::ranges {
|
| 7 |
template<range R>
|
| 8 |
requires is_object_v<R>
|
| 9 |
class ref_view : public view_interface<ref_view<R>> {
|
| 10 |
private:
|
| 11 |
-
R* r_
|
|
|
|
| 12 |
public:
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
template<not-same-as<ref_view> T>
|
| 16 |
requires see below
|
| 17 |
constexpr ref_view(T&& t);
|
| 18 |
|
| 19 |
constexpr R& base() const { return *r_; }
|
| 20 |
|
|
@@ -29,32 +28,33 @@ namespace std::ranges {
|
|
| 29 |
{ return ranges::size(*r_); }
|
| 30 |
|
| 31 |
constexpr auto data() const requires contiguous_range<R>
|
| 32 |
{ return ranges::data(*r_); }
|
| 33 |
};
|
|
|
|
| 34 |
template<class R>
|
| 35 |
ref_view(R&) -> ref_view<R>;
|
| 36 |
}
|
| 37 |
```
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
-
template<
|
| 41 |
requires see below
|
| 42 |
constexpr ref_view(T&& t);
|
| 43 |
```
|
| 44 |
|
|
|
|
|
|
|
|
|
|
| 45 |
*Remarks:* Let *`FUN`* denote the exposition-only functions
|
| 46 |
|
| 47 |
``` cpp
|
| 48 |
void FUN(R&);
|
| 49 |
void FUN(R&&) = delete;
|
| 50 |
```
|
| 51 |
|
| 52 |
-
The expression in the *requires-clause* is equivalent to
|
| 53 |
|
| 54 |
``` cpp
|
| 55 |
convertible_to<T, R&> && requires { FUN(declval<T>()); }
|
| 56 |
```
|
| 57 |
|
| 58 |
-
*Effects:* Initializes *r\_* with
|
| 59 |
-
`addressof(static_cast<R&>(std::forward<T>(t)))`.
|
| 60 |
-
|
|
|
|
| 1 |
#### Class template `ref_view` <a id="range.ref.view">[[range.ref.view]]</a>
|
| 2 |
|
| 3 |
+
`ref_view` is a view of the elements of some other range.
|
| 4 |
|
| 5 |
``` cpp
|
| 6 |
namespace std::ranges {
|
| 7 |
template<range R>
|
| 8 |
requires is_object_v<R>
|
| 9 |
class ref_view : public view_interface<ref_view<R>> {
|
| 10 |
private:
|
| 11 |
+
R* r_; // exposition only
|
| 12 |
+
|
| 13 |
public:
|
| 14 |
+
template<different-from<ref_view> T>
|
|
|
|
|
|
|
| 15 |
requires see below
|
| 16 |
constexpr ref_view(T&& t);
|
| 17 |
|
| 18 |
constexpr R& base() const { return *r_; }
|
| 19 |
|
|
|
|
| 28 |
{ return ranges::size(*r_); }
|
| 29 |
|
| 30 |
constexpr auto data() const requires contiguous_range<R>
|
| 31 |
{ return ranges::data(*r_); }
|
| 32 |
};
|
| 33 |
+
|
| 34 |
template<class R>
|
| 35 |
ref_view(R&) -> ref_view<R>;
|
| 36 |
}
|
| 37 |
```
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
+
template<different-from<ref_view> T>
|
| 41 |
requires see below
|
| 42 |
constexpr ref_view(T&& t);
|
| 43 |
```
|
| 44 |
|
| 45 |
+
*Effects:* Initializes *r\_* with
|
| 46 |
+
`addressof(static_cast<R&>(std::forward<T>(t)))`.
|
| 47 |
+
|
| 48 |
*Remarks:* Let *`FUN`* denote the exposition-only functions
|
| 49 |
|
| 50 |
``` cpp
|
| 51 |
void FUN(R&);
|
| 52 |
void FUN(R&&) = delete;
|
| 53 |
```
|
| 54 |
|
| 55 |
+
The expression in the *requires-clause* is equivalent to:
|
| 56 |
|
| 57 |
``` cpp
|
| 58 |
convertible_to<T, R&> && requires { FUN(declval<T>()); }
|
| 59 |
```
|
| 60 |
|
|
|
|
|
|
|
|
|