G
Guest
With the below example (taken from MSDN)..
This also makes visible the set_Size and get_Size methods, and generates
the Size property as we normally see it.
Why didnt the get_ and set_ methods be private like the rest so just the
Size property thats generated is visible? Doesnt make sense to have them
visible.
__gc class MyClass
{
public:
MyClass() : m_size(0) {}
__property int get_Size() { return m_size; }
__property void set_Size(int value) { m_size = value; }
// compiler generates a pseudo data member called Size
protected:
int m_size;
};
This also makes visible the set_Size and get_Size methods, and generates
the Size property as we normally see it.
Why didnt the get_ and set_ methods be private like the rest so just the
Size property thats generated is visible? Doesnt make sense to have them
visible.
__gc class MyClass
{
public:
MyClass() : m_size(0) {}
__property int get_Size() { return m_size; }
__property void set_Size(int value) { m_size = value; }
// compiler generates a pseudo data member called Size
protected:
int m_size;
};