NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2758

'const' : must be initialized in constructor base/member initializer list

The constructor does not initialize the const variable in an initializer list. The compiler leaves the constant undefined. Reference and const member variables must be given a value when initialized or in the constructor.

The following sample generates C2758:

struct A {
   const int i;

   A(int i){   // C2758
   // try ...
   // A(int i) : i(0) {
   };

};

void main() {
}