Skip to content

Commit

Permalink
fix: s/インスタンス化/実体化/
Browse files Browse the repository at this point in the history
  • Loading branch information
yumetodo committed Mar 20, 2024
1 parent 56695bc commit 49d191b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lang/cpp17/if_constexpr.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int main()

### `static_assert`宣言に関する例外

後に述べる2段階名前探索に関する注意点とは関係なく、C++23以降、もしくはCWG 2518が適用された環境においては、template文(もしくは適切な特殊化や`constexpr if`文の中の文)が実際にインスタンス化されない限り`static_assert`宣言による失敗は無視される。
後に述べる2段階名前探索に関する注意点とは関係なく、C++23以降、もしくはCWG 2518が適用された環境においては、template文(もしくは適切な特殊化や`constexpr if`文の中の文)が実際に実体化されない限り`static_assert`宣言による失敗は無視される。

```cpp example
#include <cstdint>
Expand All @@ -109,7 +109,7 @@ void f(T t) {

void g(std::int8_t c) {
std::int32_t n = 0;
f(n); // OK: nはstd::int32_t型なので`use(t);`のほうがインスタンス化されるために、static_assert宣言の失敗は無視される。
f(n); // OK: nはstd::int32_t型なので`use(t);`のほうが実体化されるために、static_assert宣言の失敗は無視される。
f(c); // error: cはstd::int8_t型なので、static_assert宣言は失敗し、"must be 32bit"とコンパイラが診断メッセージを出力する
}
```
Expand Down

0 comments on commit 49d191b

Please sign in to comment.