Pure functions as initializers for immutable structures?

Steven Schveighoffer schveiguy at yahoo.com
Mon Oct 18 11:53:15 PDT 2010


On Mon, 18 Oct 2010 14:31:26 -0400, Tomek Sowiński <just at ask.me> wrote:

> Initializing immutable structures is a source of constant grief.  
> Anything non-trivial requires instancing a mutable structure,  
> initializing it, and then either casting to immutable (it's up to you to  
> ensure no alias leaked) or, not to violate the type system, duplicate  
> the whole.

Aren't we supposed to get so-called immutable constructors?

If that's not what you mean, can you give an example of such grief?

I admit I don't use immutable structs/objects in day-to-day coding.

-Steve


More information about the Digitalmars-d mailing list