Skip to content

Commit

Permalink
C++20 constinit : mutex/unique_ptrのコンストラクタと相互リンク
Browse files Browse the repository at this point in the history
  • Loading branch information
faithandbrave committed Jun 14, 2023
1 parent 0376f47 commit 5af768a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lang/cpp20/constinit.md
Expand Up @@ -196,6 +196,9 @@ int main() {}
## 関連項目

- [C++11 `constexpr`](/lang/cpp11/constexpr.md)
- [`mutex`のコンストラクタ](/reference/mutex/mutex/op_constructor.md)
- [`unique_ptr`のコンストラクタ](/reference/memory/unique_ptr/op_constructor.md)


## 参照

Expand Down
4 changes: 4 additions & 0 deletions reference/memory/unique_ptr/op_constructor.md
Expand Up @@ -167,6 +167,10 @@ int main()
- 2012までは、delete宣言に対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。


## 関連項目
- [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md)


## 参照
- [N2435 Explicit bool for Smart Pointers](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2435.htm)
- (6)の経緯となる提案文書
Expand Down
6 changes: 5 additions & 1 deletion reference/mutex/mutex/op_constructor.md
Expand Up @@ -10,7 +10,7 @@ constexpr mutex() noexcept; // (1)
mutex(const mutex&) = delete; // (2)
```
## mutexオブジェクトの構築
## 概要
- (1) : デフォルトコンストラクタ。`mutex`オブジェクトの初期化を行う。
- (2) : コピーコンストラクタ。コピー不可。
Expand Down Expand Up @@ -106,6 +106,10 @@ A
- 2012はコピーコンストラクタのdeleteに対応していないため、代わりにprivateで宣言のみ行う手法で代用されている。
## 関連項目
- [C++20 コンパイル時初期化を強制する`constinit`キーワードを追加](/lang/cpp20/constinit.md)
## 参照
- [Constant Initialization - 雑貨's tumblr](https://zakkas783-blog-blog.tumblr.com/post/25490513807/constant-initialization)
- [mutexのconstexprコンストラクタ - yohhoyの日記](http://d.hatena.ne.jp/yohhoy/20120621/p1)
Expand Down

0 comments on commit 5af768a

Please sign in to comment.