Программы на C++. Форум разработчиков
-
Anonymous
Проблема с вложенными требованиями в случае концепций C++.
Сообщение
Anonymous »
Я изучаю вложенные требования в концепциях C++. Рассмотрим приведенный ниже фрагмент кода:
Код: Выделить всё
#include
#include
// Nested requirement
template
concept VariadicAddable = requires(Ts... vs)
{
(... + vs); // + operator is provided
requires sizeof...(Ts) > 1; // Atleast two arguments are provided
};
template
auto add_variadic(Ts... vs)
{
return (... + vs);
}
int main()
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79084643/trouble-with-nested-requirements-in-case-of-c-concepts[/url]
1728881853
Anonymous
Я изучаю вложенные требования в концепциях C++. Рассмотрим приведенный ниже фрагмент кода:
[code]#include
#include
// Nested requirement
template
concept VariadicAddable = requires(Ts... vs)
{
(... + vs); // + operator is provided
requires sizeof...(Ts) > 1; // Atleast two arguments are provided
};
template
auto add_variadic(Ts... vs)
{
return (... + vs);
}
int main()
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79084643/trouble-with-nested-requirements-in-case-of-c-concepts[/url]