6 ms·
> you don't need both a "const" keyword and a "mutable" keyword What if the lang has pointers? How express read-only?
by alcover 11mo ago
> you don't need both a "const" keyword and a "mutable" keyword
What if the lang has pointers? How express read-only?
- skeezyjefferson 11mo agocompiler flags with line and column number seems like the easiest way
- Thorrez 11mo agoYou can make everything read-only by default, and if you need non-read-only, you use "mutable".
- alcover 11mo agoYou need two keywords. One for assignability and one for writability : const ptr; // can't reassign, can't write-through (if r/o by default) const mut ptr; // can write