.
++ private getter setter, ++ - const-.
#, const-, , , , , .
, , , (, List). , , , :
class Contrived
{
private List<Things> m_List = new List<Things>();
public List<Things> LIST{ get {return m_List;} }
};
, , , , :
class Contrived
{
private List<Things> m_List = new List<Things>();
public IEnumerable<Things> LIST{ get {return m_List;} }
};
, , , .;-) , , , , , (, Things IUnmoddableThing ):
class Contrived
{
private List<Things> m_List = new List<Things>();
public IEnumerable<IUnmoddableThing> LIST{
get
{
List<IUnmoddableThing> temp = new List<IUnmoddableThing>();
... copy m_List into temp ...
return temp;
} }
};
, , member. , , , , ... , , ...
, ( ) getter/setter get/set ( ) , , .