編譯器錯誤 C3908
存取層級限制小於 'construct'
屬性存取子方法 (get 或 set) 不能比屬性本身所指定的存取限制性較低。 同樣地,針對事件存取子方法。
下列範例會產生 C3908:
// C3908.cpp
// compile with: /clr
ref class X {
protected:
property int i {
public: // C3908 property i is protected
int get();
private:
void set(int); // OK more restrictive
};
};