On Feb 27, 2006, at 11:35 AM, Joe Buck wrote:
On Mon, Feb 27, 2006 at 12:00:42PM -0000, Dave Korn wrote:
It has been illegal to initialise a static class member inside the class definition since sometime back in the early 90s. You must provide a static
instantiation elsewhere and initialise that.

g++ used to allow in-class-definition initializations that the standard does not; some of these have either bit-rotted or been removed over time.

I would be curious to know why the standards committee decided not to allow pointers to members as initializers inside classes. It seems like it would always be a constant that could be computed at compile time -- but maybe I'm missing something. I can, perhaps, understand why it is not allowed within the class as the class is being defined (or declared). But, relative to all the other hard things that a C++ compiler has to figure out at compile time, that seems relatively simple as well.

Reply via email to