4 ms·
Isn't that expected since 'y' is still non-const though? In your example, I'd expect 'x' to not escape, since a const-cast of it is undefined.
by gameman144 3y ago
Isn't that expected since 'y' is still non-const though? In your example, I'd expect 'x' to not escape, since a const-cast of it is undefined.
- celrod 3y agoUnfortunately, `x` does escape, merely because we initialized it via assigning to it from a non-const.