After reading this and this I still feel confused about this kind of expressions:
static constexpr int = 0; AFAIK, in C++:
staticensures life-time memory address along whole execution and safe initialization with concurrent threadsconstexprensures time-compilation evaluation as rvalue, which means it shall have no memory address
They look contradictory to me. static ensures the variable will have a long-time memory address whereas constexpr ensures the opposite assumption. Surprisingly, the discussion in the first link mentions this:
constexpr int x = 3; const int* p = &x; How can we even obtain the memory address of x if it is an rvalue?
Could anyone explain it?
constexprand value category (evaluation as rvalue) has any connection.static constexpr, I am not sure which kind that should be. In any case, could you briefly explain both?constexprvariable having no address.