E2242 'specifier' には VCL 形式のクラス型が必要 (C++)

提供: RAD Studio
移動先: 案内検索

コンパイラのエラーと警告(C++):インデックス への移動

stored,default,nodefault の格納指定子は,Delphi スタイルのクラス型のプロパティ宣言でのみ使用できます。

次に例を示します。



 struct regclass
 {
      int __property ip1 = { stored  = false }; // エラー
      int __property ip2 = { default = 42    }; // エラー
      int __property ip3 = { nodefault       }; // エラー
 };
 struct __declspec(delphiclass) clxclass
 {
      int __property ip1 = { stored  = false }; // OK
      int __property ip2 = { default = 42    }; // OK
      int __property ip3 = { nodefault       }; // OK
 };