#include int main() { int i = 0; std::thread t1([&]{ ++i; }); std::thread t2([&]{ --i; }); t1.join(); t2.join(); }