We recommend using Visual Studio 2017

Compiler Error C3913


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 C3913.

default property must be indexed

A default property was defined incorrectly.

For more information, see property.

The following sample generates C3913:

// C3913.cpp  
// compile with: /clr /c  
ref struct X {  
   property int default {   // C3913  
   // try the following line instead  
   // property int default[int] {  
      int get(int) { return 0; }  
      void set(int, int) {}