Compiler Error C3895
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C3895.
var' : type data members cannot be 'volatile'
Certain kinds of data members, for example literal or initonly, cannot be volatile.
The following sample generates C3895:
// C3895.cpp
// compile with: /clr
ref struct Y1 {
initonly
volatile int data_var2; // C3895
};
Show: