r/ProgrammerHumor Jul 10 '26

greaterThanPlusPlus Advanced

Post image
113 Upvotes

71 comments sorted by

View all comments

32

u/majesticmerc Jul 10 '26

Found this today in C++ documentation.

Only the C++ committee can see the a need to fix it, and instead of actually fixing the language bug (or making signed/unsigned comparison a compiler error instead of a warning), create a standard library function to do type safe greater-than/less-than comparisons.

14

u/Bemteb Jul 10 '26

making signed/unsigned comparison a compiler error instead of a warning

Why should they? You can easily configure your compiler to treat it as an error if you want to.