Skip to content

Commit

Permalink
span,basic_string_view: P2251対応(#1062)
Browse files Browse the repository at this point in the history
  • Loading branch information
yohhoy committed Jan 24, 2023
1 parent 6e6d1c5 commit 0201450
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions reference/span/span.md
Expand Up @@ -31,6 +31,8 @@ namespace std {
文字列操作に特化したクラスとして[`std::basic_string_view`](/reference/string_view/basic_string_view.md)が定義されているが、こちらはメモリ連続性をもつあらゆるコンテナに適用できる。
このクラスは、[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である(C++23)
### メモリ連続性
このクラスの対象は、メモリの連続性を持つシーケンスである。例として、以下は対象のシーケンスである:
Expand Down Expand Up @@ -276,3 +278,5 @@ int main()
- [P2116R0 Remove tuple-like protocol support from fixed-extent `span`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2116r0.html)
- [P0896R4 The One Ranges Proposal (was Merging the Ranges TS)](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r4.pdf)
- [P2325R3 Views should not be required to be default constructible](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2325r3.html)
- [Require `span` & `basic_string_view` to be Trivially Copyable](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2251r1.pdf)
- C++23から、トリビアルコピー可能が保証される。
4 changes: 4 additions & 0 deletions reference/string_view/basic_string_view.md
Expand Up @@ -31,6 +31,8 @@ string_view hello = sv.substr(0, 5); // 先頭5文字を抽出する

このクラスの実装としては、文字配列の参照する先頭文字へのポインタと、文字数の2つをメンバ変数として持つ。これらの変数を変動させることによって、部分文字列の抽出や、限定された範囲内での検索といったことを実現する。

このクラスは、[トリビアルコピー可能](/reference/type_traits/is_trivially_copyable.md)である(C++23)


## メンバ関数
### 構築・破棄
Expand Down Expand Up @@ -321,3 +323,5 @@ C
- [P0254R2 Integrating `std::string_view` and `std::string`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf)
- [P0403R0 Literal suffixes for `basic_string_view`](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0403r0.html)
- [String literals make bad ranges - Andrzej's C++ blog](https://akrzemi1.wordpress.com/2019/09/25/string-literals-make-bad-ranges/)
- [Require `span` & `basic_string_view` to be Trivially Copyable](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2251r1.pdf)
- C++23から、トリビアルコピー可能が保証される。

0 comments on commit 0201450

Please sign in to comment.