.NET 4.0 has a nice utility class called System.Lazy that does lazy object initialization. I would like to use this class for a 3.5 project. One time I saw an implementation
Some funny (but not very usable) stuff can be added: implicit coversion from delegate:
public static implicit operator Lazy(Func initializer)
{
return new Lazy(initializer);
}
And usage
private static Lazy Value = new Func(() => 24 * 22);
C# compiler have some problem with performing this conversion, for example assigning lambda expression does not work, but it is one more thing causes your colleguas to think a bit :)