#include "demo.h" #include int main() { int x = 0; puts( "starting thread" ); std::thread t1( [&] { puts( "thread started" ); ++x; puts( "thread done" ); } ); for ( int i = 0; i < 10; ++i ) { puts( "incrementing" ); ++x; } puts( "waiting for the thread" ); t1.join(); puts( "thread joined" ); // assert( x == 2 ); /* ERROR */ }