Код: Выделить всё
error: variable 'process_arg' set but not used [-Werror=unused-but-set-variable]
const auto process_arg = [&](const T& arg) -> bool
< /code>
#include
template
concept Computable = std::integral || std::floating_point;
template
bool foo(const double&, Args... args)
{
const auto process_arg = [&](const T& /*arg*/) -> bool
{
return true;
};
if (!(process_arg(args) && ...))
{
return false;
}
return true;
}
afaict, это происходит потому, что могут быть вызовы, сделанные в foo () , которые имеют только первоначальный двойной , и никаких других аргументов. PrettyPrint-Override ">
Код: Выделить всё
[[maybe_unused]] const auto process_arg = [&](const T& /*arg*/) -> bool
Подробнее здесь: https://stackoverflow.com/questions/797 ... -a-fold-op
Мобильная версия