Код: Выделить всё
#include
#include
#include
int main()
{
std::vector threads;
for (int i = 0; i < 3; i++)
{
threads.emplace_back([&](){
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78361217/c-stdthread-undefined-behavior-with-capture-default[/url]