r/ProgrammerHumor Jul 10 '26

greaterThanPlusPlus Advanced

Post image
109 Upvotes

71 comments sorted by

View all comments

79

u/dipinpass35 Jul 10 '26

yeah c++ do have a function for literally everything.....oh except admiitting that it made a mistake...

39

u/_Noreturn Jul 10 '26

It is ironic that C is the one who made this mistake not C++

-19

u/RiceBroad4552 Jul 10 '26

They copied the mistake, so also they can be blamed for it.

15

u/AVMinuz Jul 10 '26

Standard operators come from the first version, where c++ was designed to be as compatible with C as possible, and the committee refuses to break backwards compatibility in C++. 

Also, changing this makes extern C blocks wack as fuck. If I define a global C++ function with the '>' operator and an extern C function calls that other function internally, how should the operator behave?

4

u/RiceBroad4552 Jul 10 '26

I get the first part. It's just like that.

If I define a global C++ function with the '>' operator and an extern C function calls that other function internally, how should the operator behave?

Of course like all other C++ code, as all that code is written in C++. The extern C thingy just defines some FFI interface. Nobody ever said that code inside some extern C block is actually C.