How to create an overwriteable struct that is always const?

David Zhang straivers98 at gmail.com
Sun Jun 2 02:22:02 UTC 2019


On Saturday, 1 June 2019 at 13:00:50 UTC, ag0aep6g wrote:

> How is setting/replacing different from modifying?

e.g.:

     S s;

     this() { s = ...; }

     update(S s) { this.s = s; }

     mod(int i) { s.i = i; } // illegal

Kinda like how strings can be copied and assigned to, but not 
modified.



More information about the Digitalmars-d-learn mailing list