On Mon, 13 May 2013 14:55:01 -0600, nvangogh wrote:
> So out of curiosity - why were (are) in class initializers prohibited in
> old c++?
Prior to being standardized, C++ did not allow *any* in-class
initializers, not even for static const integer members.
As far as I can determine, the philosophy was that initialization has no
place in a declaration, the initialization of non-static members is the
task of the constructor and the initialization of static members should
occur in the definition of that member.
To my knowledge, the languages that Bjarne Stroustrup got his ideas for C+
+ from did not have in-class initialization syntax either, so there was
no precedent to add it.
After C++ was standardized, new languages started to emerge that *did*
provide a syntax to provide in-class initializers and this probably led
to them being added to C++11.
Bart v Ingen Schenau