Код: Выделить всё
consteval bool IsEven(int n) {
return 0 == n % 2;
}
template
requires (IsEven(n)) // ok
void f1() {}
template
requires IsEven(n) // error: Atomic constraint must be of type 'bool'
// (found '')
void f2() {}
Почему выражение постоянной функции НЕ является основным выражением?
Подробнее здесь: https://stackoverflow.com/questions/793 ... expression
Мобильная версия