Код: Выделить всё
#include
#include
#include
int main(){
std::ofstream outFile("example.txt", std::ios::out | std::ios::trunc);
std::atomic flag = false;
auto t1 = std::thread([&](){
outFile
Подробнее здесь: [url]https://stackoverflow.com/questions/79855089/does-the-happen-before-guarantee-the-order-of-delivery-for-data-to-a-file[/url]