Код: Выделить всё
#include
#include
struct Foo
{
int value = 1;
Foo() = default;
Foo(const Foo &) {}
Foo(Foo &&)
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/62591304/move-constructor-called-twice-when-move-constructing-a-stdfunction-from-a-lamb[/url]