Partager via


Erreur du compilateur C3913

la propriété par défaut doit être indexée

Une propriété par défaut a été définie de manière incorrecte.

Pour plus d'informations, consultez property.

L’exemple suivant génère l’erreur 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) {}
   }
};