Poznámka:
Přístup k této stránce vyžaduje autorizaci. Můžete se zkusit přihlásit nebo změnit adresáře.
Přístup k této stránce vyžaduje autorizaci. Můžete zkusit změnit adresáře.
'property': vlastnost nemá metodu set.
Poznámky
Metoda přístupového objektu set vlastnosti nebyla definována. Další informace naleznete v tématu vlastnost.
Example
Následující příklad vygeneruje C3070:
// C3070.cpp
// compile with: /clr
ref class R {
public:
R(int size) {
m_data = gcnew array<int>(size);
}
property int % MyProp[int] {
int% get(int index) {
return m_data[index];
}
}
property int % MyProp2[int] {
int% get(int index) {
return m_data[index];
}
void set(int index, int % value) {}
}
property const int % MyProp3[int] {
const int% get(int index) {
return m_data[index];
}
void set(int index, const int % value) {}
}
private:
array<int>^ m_data;
};
int main() {
R^ r = gcnew R(10);
r->MyProp[4] = 4; // C3070
int value = 4;
r->MyProp2[4] = value; // OK
r->MyProp3[4] = 4; // OK
}