4 ms·
> Additionally, the compiler generally cannot assume that Foo_bar does not modify Foo as it is legal to cast away const No, but it can warn you! The type is
by lelanthran 3y ago
> Additionally, the compiler generally cannot assume that Foo_bar does not modify Foo as it is legal to cast away const
No, but it can warn you!
The type is meant to capture programmer intention, and if you use `const` the compiler can warn you that your intention does not match the intention of the existing code (like, the intention of the author who wrote Foo_Bar).