How to create immutable struct?

denizzzka 4denizzz at gmail.com
Sat Oct 6 08:17:28 PDT 2012


I am have struct with constructor:

immutable struct Cell {
...
}

And I trying to create instance of this struct:

immutable (Cell)* s = new Cell( v, s);

compiler returns error:

Error: cannot implicitly convert expression (new Cell(v,s)) of 
type Cell* to immutable(Cell)*

How to pass immutable to new?


More information about the Digitalmars-d-learn mailing list