
21 Oct
2008
21 Oct
'08
7:03 p.m.
Simonson, Lucanus J wrote:
Also, your get function returns a reference to coordinate. It should return by value. Many legacy point types may have a public API that prohibits direct access to their members because that is what good little C++ programmers were taught to do in school. Those point classes could not conform to your concept.
This is not a problem, you just have to write a proxy. That kind of thing is done very often to achieve operator[] overloading with different semantics for reads and writes. It's also done a lot for iterators, which also return references.