Y
Hacker News
new
|
ask
|
show
|
jobs
by
Thorrez
236 days ago
You can make everything read-only by default, and if you need non-read-only, you use "mutable".
1 comments
alcover
236 days ago
You 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
link