AA and struct with const member

frame frame86 at live.com
Tue Dec 28 22:36:42 UTC 2021


On Tuesday, 28 December 2021 at 14:48:24 UTC, Era Scarecrow wrote:

>  Probably better to make data private vs making it const. I 
> tend to use const far more as input arguments to help denote it 
> won't change references and less for elements in a struct. That 
> or make it a class? I'm not sure.

It's a matter of consistency - if a function returns something in 
const one should be able to store it without any type 
modification.


More information about the Digitalmars-d-learn mailing list