Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Maxatar
· 1y ago · 0 comments
It's the optimization that C++ is unable to perform, not the immutability.
Comments
[–]
CyberDildonics
1y ago
Are you talking about optimizing out bounds checking that isn't happening in the first place?
[–]
pptr
1y ago
If you declare using an invalidated iterator as UB, the compiler can optimize as if the container was effectively immutable during the loop.