Skip to content

Commit 2a23e4d

Browse files
committed
empty_view : メンバ関数を追加 #713
1 parent 38de7a5 commit 2a23e4d

File tree

6 files changed

+159
-15
lines changed

6 files changed

+159
-15
lines changed

reference/ranges/empty_view.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@
88
namespace std::ranges {
99
template<class T>
1010
requires is_object_v<T>
11-
class empty_view : public view_interface<empty_view<T>> { // (1)
12-
public:
13-
static constexpr T* begin() noexcept { return nullptr; }
14-
static constexpr T* end() noexcept { return nullptr; }
15-
static constexpr T* data() noexcept { return nullptr; }
16-
static constexpr size_t size() noexcept { return 0; }
17-
static constexpr bool empty() noexcept { return true; }
18-
};
11+
class empty_view : public view_interface<empty_view<T>> { …… }; // (1)
1912

2013
namespace views {
2114
template<class T>
@@ -42,13 +35,13 @@ namespace std::ranges {
4235
4336
## 静的メンバ関数
4437
45-
| 名前 | 説明 | 対応バージョン |
46-
|--------------------------------------------------|----------------------------------|----------------|
47-
| [`begin`](empty_view/begin.md.nolink) | 先頭を指すイテレータを取得する | C++20 |
48-
| [`end`](empty_view/end.md.nolink) | 番兵を取得する | C++20 |
49-
| [`data`](empty_view/data.md.nolink) | 配列の先頭へのポインタを取得する | C++20 |
50-
| [`size`](empty_view/size.md.nolink) | 要素数を取得する | C++20 |
51-
| [`empty`](empty_view/empty.md.nolink) | Rangeが空かどうかを判定する | C++20 |
38+
| 名前 | 説明 | 対応バージョン |
39+
|--------------------------------|----------------------------------|----------------|
40+
| [`begin`](empty_view/begin.md) | 先頭を指すイテレータを取得する | C++20 |
41+
| [`end`](empty_view/end.md) | 番兵を取得する | C++20 |
42+
| [`data`](empty_view/data.md) | 配列の先頭へのポインタを取得する | C++20 |
43+
| [`size`](empty_view/size.md) | 要素数を取得する | C++20 |
44+
| [`empty`](empty_view/empty.md) | Rangeが空かどうかを判定する | C++20 |
5245
5346
## 継承しているメンバ関数
5447
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# begin
2+
* ranges[meta header]
3+
* std::ranges[meta namespace]
4+
* empty_view[meta class]
5+
* function[meta id-type]
6+
* cpp20[meta cpp]
7+
8+
```cpp
9+
static constexpr T* begin() noexcept; // (1) C++20
10+
```
11+
12+
## 概要
13+
`view`の先頭要素を指すイテレータを取得する。
14+
15+
## 戻り値
16+
17+
```cpp
18+
return nullptr;
19+
```
20+
21+
22+
## バージョン
23+
### 言語
24+
- C++20
25+
26+
### 処理系
27+
- [Clang](/implementation.md#clang): 13.0.0 [mark verified]
28+
- [GCC](/implementation.md#gcc): 10.1.0 [mark verified]
29+
- [ICC](/implementation.md#icc): ?
30+
- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# data
2+
* ranges[meta header]
3+
* std::ranges[meta namespace]
4+
* empty_view[meta class]
5+
* function[meta id-type]
6+
* cpp20[meta cpp]
7+
8+
```cpp
9+
static constexpr T* data() noexcept; // (1) C++20
10+
```
11+
12+
## 概要
13+
配列の先頭へのポインタを取得する。
14+
15+
## 戻り値
16+
17+
```cpp
18+
return nullptr;
19+
```
20+
21+
22+
## バージョン
23+
### 言語
24+
- C++20
25+
26+
### 処理系
27+
- [Clang](/implementation.md#clang): 13.0.0 [mark verified]
28+
- [GCC](/implementation.md#gcc): 10.1.0 [mark verified]
29+
- [ICC](/implementation.md#icc): ?
30+
- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# empty
2+
* ranges[meta header]
3+
* std::ranges[meta namespace]
4+
* empty_view[meta class]
5+
* function[meta id-type]
6+
* cpp20[meta cpp]
7+
8+
```cpp
9+
static constexpr bool empty() noexcept; // (1) C++20
10+
```
11+
12+
## 概要
13+
Rangeが空かどうかを判定する。
14+
15+
## 戻り値
16+
17+
```cpp
18+
return true;
19+
```
20+
21+
22+
## バージョン
23+
### 言語
24+
- C++20
25+
26+
### 処理系
27+
- [Clang](/implementation.md#clang): 13.0.0 [mark verified]
28+
- [GCC](/implementation.md#gcc): 10.1.0 [mark verified]
29+
- [ICC](/implementation.md#icc): ?
30+
- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified]

reference/ranges/empty_view/end.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# end
2+
* ranges[meta header]
3+
* std::ranges[meta namespace]
4+
* empty_view[meta class]
5+
* function[meta id-type]
6+
* cpp23[meta cpp]
7+
8+
```cpp
9+
static constexpr T* end() noexcept; // (1) C++20
10+
```
11+
12+
## 概要
13+
14+
番兵を取得する。
15+
16+
17+
## 戻り値
18+
19+
```cpp
20+
return nullptr;
21+
```
22+
23+
## バージョン
24+
### 言語
25+
- C++20
26+
27+
### 処理系
28+
- [Clang](/implementation.md#clang): 13.0.0 [mark verified]
29+
- [GCC](/implementation.md#gcc): 10.1.0 [mark verified]
30+
- [ICC](/implementation.md#icc): ?
31+
- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# size
2+
* ranges[meta header]
3+
* std::ranges[meta namespace]
4+
* empty_view[meta class]
5+
* function[meta id-type]
6+
* cpp20[meta cpp]
7+
8+
```cpp
9+
static constexpr size_t size() noexcept; // (1) C++20
10+
```
11+
12+
## 概要
13+
要素数を取得する。
14+
15+
## 戻り値
16+
17+
```cpp
18+
return 0;
19+
```
20+
21+
22+
## バージョン
23+
### 言語
24+
- C++20
25+
26+
### 処理系
27+
- [Clang](/implementation.md#clang): 13.0.0 [mark verified]
28+
- [GCC](/implementation.md#gcc): 10.1.0 [mark verified]
29+
- [ICC](/implementation.md#icc): ?
30+
- [Visual C++](/implementation.md#visual_cpp): 2019 Update 10 [mark verified]

0 commit comments

Comments
 (0)