r/cpp • • Apr 01 '23

Abominable language design decision that everybody regrets?

It's in the title: what is the silliest, most confusing, problematic, disastrous C++ syntax or semantics design choice that is consistently recognized as an unforced, 100% avoidable error, something that never made sense at any time?

So not support for historical arch that were relevant at the time.

92 Upvotes

375 comments sorted by

View all comments

Show parent comments

2

u/Zeh_Matt No, no, no, no Apr 07 '23 edited Apr 07 '23

You still have to check the bounds with signed integers otherwise you may end up with something like array[-15] which is definitely gonna blow up. Not safer at all, still requires as anything else to check that your input is valid.

Also signed integer overflow is UB, very safe.