Property Function

Property Function is a function that behaves like a variable, that can be got or set. The calling function sets its new value by including it in the caller's argument.
 avatar
lucdoitlab
d
5 months ago
183 B
5
Indexable
D snippets
struct Foo
{
    @property int data() { return m_data; } // read property

    @property int data(int value) { return m_data = value; } // write property

  private:
    int m_data;
}
Editor is loading...
Leave a Comment