Some c++ STL containers provide getters like
Foo.first
Foo.second
which apart from being very practical, improve code readability. Now suppose that I want to reproduce that feature in one of my own classes. Is it possible to define methods like
Matrix.components
Matrix.size
instead of
Matrix.components()
Matrix.size()
(same but without parentheses)? How could it be achieved?