Код: Выделить всё
template
inline constexpr auto c = sizeof(T) + sizeof...(Args) > 1;
template
requires c // ok
void f1() {
}
template
concept C = sizeof(T) + sizeof...(Args) > 1;
template
requires C // error: Pack expansion used as argument
// for non-pack parameter of concept.
void f2() {
}
int main() {
f1(); // ok
f2(); // error
}
- см. https://godbolt.org/z/gewfoqdg9,/p>br/>
- cwg1430: https://cplusplus.github.io/cwg/issues/1430.html
cwg2686: https://cplusplus.github.io/cwg/issues/2686.htmlенно />
Подробнее здесь: https://stackoverflow.com/questions/797 ... n-concepts
Мобильная версия