const or immutable?

Kagamin spam at here.lot
Wed Sep 22 21:34:15 UTC 2021


My guideline is that most stuff is mutable, so there's little 
reason to try to make it const. For most simple types like 
scalars and arrays const is relatively cheap and useful, but its 
usefulness decreases with complexity of the type, the more 
complex is the type the more likely it's mutable. Strings often 
benefit from immutability.


More information about the Digitalmars-d mailing list