For a unit test that I’m writing for some code at the moment, I need to create a thread that doesn’t do anything. Well, the easiest way to do this is to do a lambda function. And since we don’t need to capture anything, and the thread doesn’t need to do anything, I have written the following line of code:
std::thread thr = std::thread( [](){} );
Just look at it in its simplicity. In case you missed it:
[](){}
I actually started laughing after I had written that, it’s just so stupid that it’s funny!
I think the same way, LOL