this post was submitted on 26 Feb 2024
280 points (97.0% liked)

Programmer Humor

32410 readers
1 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] P1r4nha@feddit.de 29 points 2 years ago (2 children)

Horrible code. First, it doesn't compile because there's no ; at the end of the class definition.

And then more importantly you have a private destructor which means this CriminalScum's destructor will never be called, so you can't charge it with distruction either. Or are you telling me this CriminalScum has friends?

[–] aggelalex@lemmy.world 14 points 2 years ago* (last edited 2 years ago) (1 children)

There's always an accomplice in crime.

Also, tall order to expect me to run and test a code written only for a shitpost.

[–] P1r4nha@feddit.de 7 points 2 years ago

You're charging the class for a thought crime!!

[–] observantTrapezium@lemmy.ca 6 points 2 years ago (1 children)

Also, if I'm not mistaken the uninitialized prop is not guaranteed to be nullptr here, so this private destructor could be trying to free from some random pointer.