when I want to have a static pointer as a member of a class I need constexpr
for the initialisation with nullptr
.
class Application {
private:
constexpr static Application* app = nullptr;
}
Can someone explain me why I need to do that? I cannot find the exact reason why it`s necessary that the static variable has to exist at compile time.
See Question&Answers more detail:os