this post was submitted on 15 Nov 2024
262 points (93.1% liked)

Programmer Humor

32476 readers
698 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 4 points 7 hours ago (1 children)

It makes it look like they're just adding random noise to avoid colliding with existing syntax. Maybe they can try a UUID next time...

[โ€“] [email protected] 1 points 4 hours ago

It makes perfect sense actually. I did write another comment here if you are interested.

This is how operator overloads were written going back to the initial version of C++ back in 1985. The only new thing is that we can now add = default to get the compiler to generate a default implementation that compares all the member variables for you.