Skip to content

Commit

Permalink
Merge pull request cpprefjp#833 from cpprefjp/remove-concept-non-type…
Browse files Browse the repository at this point in the history
…-constraint-patch

非型テンプレート制約を削除
  • Loading branch information
faithandbrave committed Dec 28, 2020
2 parents 93de787 + ef32aea commit 7e82207
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions lang/cpp20/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,18 +612,6 @@ int main() {
X<char> x; // requires Addable<char, int>
```

- コンセプトのテンプレートパラメータが非型である場合、そのコンセプトを使用した制約テンプレートパラメータは非型になる:
```cpp
template <int N>
concept C = N >= 0;

template <C N>
struct X {};

X<1> x;
//X<-1> y; // コンパイルエラー!制約を満たさない
```

- 制約パラメータに省略記号がついている場合、パラメータパックと見なされる。単一パラメータのコンセプトをパラメータパックにした場合、パラメータパックの各テンプレートパラメータがそのコンセプトを満たすべきという制約になる。複数パラメータをとるコンセプトをパラメータパックにした場合、そのパラメータパックに渡された引数列がコンセプトに渡される:
```cpp
template<typename T> concept C1 = true;
Expand Down

0 comments on commit 7e82207

Please sign in to comment.