Is it possible to figure out how is the state of an object at compile time? E.g. if the object is null or not: class Foo { } Foo f; static if (is_null(f)) { }