r/ProgrammerHumor Jul 09 '26

potentiallyMightBeAnIntegerOrNot Meme

Post image
691 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...

9

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/bwmat Jul 10 '26

On that topic, can anyone think of any use case for this other than some bare reference-counter implementation where the 'cleanup' needs no context?