Код: Выделить всё
#include
#include
struct A
{
int value;
}
void func(A a)
{
std::thread t([a = std::move(a)]() {
// Do something with a_inner
const int v = a.value;
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79867702/passing-a-parameter-by-value-instead-of-rvalue-reference[/url]
Мобильная версия