jeudi 13 août 2015

How do I use lazy with an initializer?

I have an array where I initialize its value at declaration time, like this:

Foo[] f = Foo[] { new Foo { y = 1 }, new Foo { y = 3 } };

How do I use lazy in this?

imaginary code

Lazy<Foo[]> f = new Lazy<Foo[]> { new Foo { y = 1 }, new Foo { y = 3 } };



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire