Код: Выделить всё
struct S {
template
static constexpr bool some_check = true;
template
requires some_check
void foo(Idx);
};
template
requires S::template some_check
void S::foo(Idx idx) {}
Код: Выделить всё
$ g++ -std=c++20 test.cpp
test.cpp:12:6: error: no declaration matches ‘void S::foo(Idx)’
12 | void S::foo(Idx idx) {}
| ^
test.cpp:7:10: note: candidate is: ‘template requires some_check void S::foo(Idx)’
7 | void foo(Idx);
| ^~~
test.cpp:1:8: note: ‘struct S’ defined here
1 | struct S {
| ^
Подробнее здесь: https://stackoverflow.com/questions/798 ... r-function
Мобильная версия