3 ms·
It's not that the comittee thinks bounds checking isn't a reasonable default. They can't change it because it will break existing code.
by rowanG077 6y ago
It's not that the comittee thinks bounds checking isn't a reasonable default. They can't change it because it will break existing code.
- gpderetta 6y agoIt will not break any valid program actually. I'm 97.5% sure that aborting or even throwing an exception on an out of bound vector::operator[] would be a fully conforming implementation. The fact is that most standard library implementations can already be easily configured to bound check, so there is little pressure to mandate this in the standard.
- yakubin 6y agoThe code, which would break, was already broken. Just in far worse ways than throwing exceptions: silent memory corruption. And there would be no backwards-compatibility breakage, since in cases, where it would throw, currently UB is triggered.
- andrewprock 6y agoThe existing code may be "broken" but it is making too much money to risk changing it for pedantic reasons.
- Koiwai 6y agoSimply do not compile them using -std=future then.