Почему пакет параметров не работает, как и ожидалось в концепциях?C++

Программы на C++. Форум разработчиков
Anonymous
Почему пакет параметров не работает, как и ожидалось в концепциях?

Сообщение Anonymous »

Код: Выделить всё

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
}
Почему f1 () OK, но f2 () плохо образуется?>

Подробнее здесь: https://stackoverflow.com/questions/797 ... n-concepts

Вернуться в «C++»