Thursday, 12 September 2013

Why does VC++ 2013 not support non-static data member initializers as promised

Why does VC++ 2013 not support non-static data member initializers as
promised

According to
http://msdn.microsoft.com/en-us/library/vstudio/hh567368%28v=vs.120%29.aspx,
VC++ 2013 now supports non-static data member initializers.
However, the following code is rejected by VC++ 2013:
struct A
{
const int n = 0; // error C2864
};
error C2864: 'A::n' : only static const integral data members can be
initialized within a class
What's the root cause? Is it a compiler bug?

No comments:

Post a Comment