Skip to content

Commit 3d75aee

Browse files
committed
add link to streambuf.
some improvements in string_view
1 parent c576264 commit 3d75aee

File tree

10 files changed

+21
-23
lines changed

10 files changed

+21
-23
lines changed

Diff for: reference/fstream/basic_filebuf.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Cの`FILE*`に対する入出力関数を使って実装される。
7272
| `sync` | 出力列の同期 (protected virtual) | |
7373
| `uflow` | (protected virtual) |
7474
| `underflow` | (protected virtual) |
75-
| `showmasync` | ブロックせずに読み取れると期待される文字数を得る (protected virtual) | |
75+
| `showmanyc` | ブロックせずに読み取れると期待される文字数を得る (protected virtual) | |
7676
| `pbackfail` | 1文字を入力列に戻す (protected virtual) | |
7777
| `overflow` | (protected virtual) |
7878

Diff for: reference/istream/basic_istream/peek.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ int_type peek() {
8989
## 参照
9090

9191
- [`basic_istream::get`](get.md)
92-
- `basic_streambuf::sgetc`
92+
- [`basic_streambuf::sgetc`](../../streambuf/basic_streambuf/sgetc.md)

Diff for: reference/istream/basic_istream/putback.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ basic_istream<CharT, Traits>& putback(char_type c) {
9696
## 参照
9797

9898
- [`basic_istream::unget`](unget.md)
99-
- `basic_streambuf::sputbackc`
99+
- [`basic_streambuf::sputbackc`](../../streambuf/basic_streambuf/sputbackc.md)

Diff for: reference/istream/basic_istream/seekg.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ basic_istream<CharT, Traits>& seekg(off_type off, seekdir dir) {
121121
## 参照
122122
123123
- [`basic_istream::tellg`](tellg.md)
124-
- `basic_streambuf::pubseekpos`
125-
- `basic_streambuf::pubseekoff`
126-
- `basic_streambuf::seekpos`
127-
- `basic_streambuf::seekoff`
124+
- [`basic_streambuf::pubseekpos`](../../streambuf/basic_streambuf/pubseekpos.md)
125+
- [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md)
126+
- [`basic_streambuf::seekpos`](../../streambuf/basic_streambuf/seekpos.md)
127+
- [`basic_streambuf::seekoff`](../../streambuf/basic_streambuf/seekoff.md)

Diff for: reference/istream/basic_istream/sync.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,4 @@ int sync() {
5656
- C++98
5757

5858
## 参照
59-
60-
- `basic_streambuf::pubsync`
59+
- [`basic_streambuf::pubsync`](../../streambuf/basic_streambuf/pubsync.md)

Diff for: reference/istream/basic_istream/tellg.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ pos_type tellg(pos_type pos) {
8383
- C++98
8484
8585
## 参照
86-
8786
- [`basic_istream::seekg`](seekg.md)
88-
- `basic_streambuf::pubseekoff`
89-
- `basic_streambuf::seekoff`
87+
- [`basic_streambuf::pubseekoff`](../../streambuf/basic_streambuf/pubseekoff.md)
88+
- [`basic_streambuf::seekoff`](../../streambuf/basic_streambuf/seekoff.md)

Diff for: reference/istream/basic_istream/unget.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ basic_istream<CharT, Traits>& unget() {
108108
## 参照
109109

110110
- [`basic_istream::putback`](putback.md)
111-
- `basic_streambuf::sungetc`
111+
- [`basic_streambuf::sungetc`](../../streambuf/basic_streambuf/sungetc.md)

Diff for: reference/string/basic_string.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ namespace std {
151151
152152
| 名前 | 説明 | 対応バージョン |
153153
|---------------------|----------------|------|
154-
| `npos` | 無効な位置を表す。`find`や`substr`などで使われる。<br/>`static const size_type npos = -1;` | |
154+
| `npos` | 無効な位置を表す。`find`や`substr`などで使われる。<br/>`static const size_type npos = -1;` | C++23からconstexpr |
155155
156156
157157
### メンバ型

Diff for: reference/string_view/basic_string_view.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ string_view hello = sv.substr(0, 5); // 先頭5文字を抽出する
116116

117117
| 名前 | 説明 | 対応バージョン |
118118
|---------------------|----------------|------|
119-
| `npos` | 無効な位置を表す。`find``substr`などで使われる。<br/>`static const size_type npos = -1;` | C++17 |
119+
| `npos` | 無効な位置を表す。`find``substr`などで使われる。<br/>`static constexpr size_type npos = -1;` | C++17 |
120120

121121

122122
### メンバ型
@@ -260,7 +260,7 @@ Hell
260260
```
261261
262262
### 文字列リテラルを範囲として使用する場合にヌル文字が含まれないようにする
263-
```cpp
263+
```cpp example
264264
#include <iostream>
265265
#include <string_view>
266266

Diff for: reference/string_view/basic_string_view/compare.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ constexpr int compare(size_type pos1,
3333
## 概要
3434
他の文字列との比較を行う。
3535
36-
- (1) : `*this`と`s`を比較する
37-
- (2) : `*this`の範囲`[pos1, pos1 + n1)`と`s`を比較する
38-
- (3) : `*this`の範囲`[pos1, pos1 + n1)`と`s`の範囲`[pos2, pos2 + n2)`を比較する
36+
- (1) : `*this`と`sv`を比較する
37+
- (2) : `*this`の範囲`[pos1, pos1 + n1)`と`sv`を比較する
38+
- (3) : `*this`の範囲`[pos1, pos1 + n1)`と`sv`の範囲`[pos2, pos2 + n2)`を比較する
3939
- (4) : `*this`と文字配列`s`を比較する
4040
- (5) : `*this`の範囲`[pos1, pos1 + n1)`と文字配列`s`を比較する
4141
- (6) : `*this`の範囲`[pos1, pos1 + n1)`と文字配列`s`の先頭`n2`文字を比較する
4242
4343
4444
## 効果
4545
- (1) :
46-
- [`size()`](size.md)と`str.`[`size()`](size.md)のうち、小さい方を`rlen`とする
46+
- [`size()`](size.md)と`sv.`[`size()`](size.md)のうち、小さい方を`rlen`とする
4747
- `int result = Traits::`[`compare`](/reference/string/char_traits/compare.md)`(`[`data()`](data.md)`, sv.`[`data()`](data.md)`, rlen);`
4848
- `result != 0`であれば`result`を返す。そうでなければ、以下のように返す:
49-
- `size() < str.size()`であれば0未満の値を返す
50-
- `size() == str.size()`であれば0を返す
51-
- `size() > str.size()`であれば0超の値を返す
49+
- `size() < sv.size()`であれば0未満の値を返す
50+
- `size() == sv.size()`であれば0を返す
51+
- `size() > sv.size()`であれば0超の値を返す
5252
- (2) : `return` [`substr`](substr.md)`(pos1, n1).compare(sv);` と等価
5353
- (3) : `return` [`substr`](substr.md)`(pos1, n1).compare(sv.`[`substr`](substr.md)`(pos2, n2));` と等価
5454
- (4) : `return compare(basic_string_view(s));` と等価

0 commit comments

Comments
 (0)