For a static variable to be initialized at compile time, it needs to be initialized by a compile-time constant, and cannot have a constructor; Otherwise, it is initialized at runtime.
Reference: Modern C++ Design: Generic Programming and Design Patterns Applied by Andrei Alexandrescu. Addison-Wesley, 2001, p. 133-134.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment