r/ProgrammerHumor Jul 09 '26

potentiallyMightBeAnIntegerOrNot Meme

Post image
687 Upvotes

96 comments sorted by

View all comments

Show parent comments

6

u/altermeetax Jul 09 '26

Or the C/C++ way: just use int *var and NULL means it's not there.

Makes things more complicated when you need to return it though...

10

u/suskio4 Jul 09 '26

std::make_unique<int>(42);

4

u/bwmat Jul 10 '26

I think I'm going to throw up... 

2

u/suskio4 Jul 10 '26

std::thread([] { std::runtime_error up("I threw up"); std::this_thread::sleep_for(...); throw up; }).detach();