4 ms·
Hence why D has two approaches with similar semantics, const and immutable. And also allows to alias non const references to the same data. Thus the data can
by pjmlp 2y ago
Hence why D has two approaches with similar semantics, const and immutable.
And also allows to alias non const references to the same data.
Thus the data can be modified by a mutable reference, owned by a specific part of the code, while everyone else only gets to see the const chain.