tmp/tmpnjbz17no/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Empty view <a id="range.empty">[[range.empty]]</a>
|
| 2 |
+
|
| 3 |
+
#### Overview <a id="range.empty.overview">[[range.empty.overview]]</a>
|
| 4 |
+
|
| 5 |
+
`empty_view` produces a `view` of no elements of a particular type.
|
| 6 |
+
|
| 7 |
+
[*Example 1*:
|
| 8 |
+
|
| 9 |
+
``` cpp
|
| 10 |
+
empty_view<int> e;
|
| 11 |
+
static_assert(ranges::empty(e));
|
| 12 |
+
static_assert(0 == e.size());
|
| 13 |
+
```
|
| 14 |
+
|
| 15 |
+
— *end example*]
|
| 16 |
+
|
| 17 |
+
#### Class template `empty_view` <a id="range.empty.view">[[range.empty.view]]</a>
|
| 18 |
+
|
| 19 |
+
``` cpp
|
| 20 |
+
namespace std::ranges {
|
| 21 |
+
template<class T>
|
| 22 |
+
requires is_object_v<T>
|
| 23 |
+
class empty_view : public view_interface<empty_view<T>> {
|
| 24 |
+
public:
|
| 25 |
+
static constexpr T* begin() noexcept { return nullptr; }
|
| 26 |
+
static constexpr T* end() noexcept { return nullptr; }
|
| 27 |
+
static constexpr T* data() noexcept { return nullptr; }
|
| 28 |
+
static constexpr size_t size() noexcept { return 0; }
|
| 29 |
+
static constexpr bool empty() noexcept { return true; }
|
| 30 |
+
};
|
| 31 |
+
}
|
| 32 |
+
```
|
| 33 |
+
|