
21 Oct
2009
21 Oct
'09
5:06 a.m.
Am Wednesday 21 October 2009 06:02:23 schrieb Edward Diener:
x.count(5); int I = x.count();
I do not believe this is the right syntax for accessing properties. The idea of a "property" is that one uses syntax to access it as if it were a data object, while it still has the backing of a function to provide constraints.
why? there is no widely used practice to use public data objects. so why would you need a property to emulate that syntax? while you might not consider accessor functions a property in the language construct sense, they do represent a property of the object they're a part of. this is widely used in the C++ standard library and boost. what's the rationale for another properties syntax?