class Interface {
public:
static const int i = 1;
static const double d = 1.0;
//! static const string *name = new string("Interface name");
virtual string getName() = 0;
}
Since C++ is a traditional truely compiled programming language,it could be easily convinced that it does allow object initialization(?).But why do C++ prohibit double initialization at the point of defintion?I see that g++ now support double initialization at the point of definition,but not msvc.
My question is,since it's easy to support primitive types - float/double initialization at the point of definition and it could make C++ programmer's life easier and happier with this convenient,why do C++ prohibit it?
P.S: Reference - 9.2.4 section of C++ standard 2003.
A member-declarator can contain a constant-initializer only if it declares a static member (9.4) of const integral or const enumeration type, see 9.4.2.