Код: Выделить всё
struct S {
int a{3};
};
using callback = std::function;
Код: Выделить всё
void f(callback&& cb) { cb(S{}); }
Код: Выделить всё
int main()
{
f([](S const& s) { std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78399296/are-value-or-const-compatible-signatures-for-stdfunction[/url]
Мобильная версия