Compiler Error C3896
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error C3896

Error Message

'member' : improper initializer: this literal data member can only be initialized with 'nullptr'

A literal (Visual C++) data member was initialized incorrectly. See nullptr for more information.

The following sample generates C3896:

// C3896.cpp
// compile with: /clr /c
ref class R{};

value class V {
   literal R ^ r = "test";   // C3896
   literal R ^ r2 = nullptr;   // OK
© 2015 Microsoft