Constructor for an immutable struct
- by Danvil
Consider the following simple immutable struct:
struct Stash {
public int X { get; private set; }
public Stash(int _x) {
X = _x;
}
}
This is not working, because the compiler wants me to initialize the "backing field" before I can access the property. How can I solve this?