4 ms·
It's the optimization that C++ is unable to perform, not the immutability.
by Maxatar 2y ago
It's the optimization that C++ is unable to perform, not the immutability.
- pptr 2y agoIf you declare using an invalidated iterator as UB, the compiler can optimize as if the container was effectively immutable during the loop.
- CyberDildonics 2y agoAre you talking about optimizing out bounds checking that isn't happening in the first place?