Boost logo

Boost :

Subject: Re: [boost] [property] interest in C# like properties for C++?
From: Sergey Sadovnikov (flex_ferrum_at_[hidden])
Date: 2009-10-24 13:24:19

Hello, Olaf.

Friday, October 23, 2009 at 8:22:41 PM you wrote:

OvdS> On Fri, Oct 23, 2009 at 5:33 PM, Edward Diener
OvdS> <eldiener_at_[hidden]> wrote:
>> You are not talking about the access syntax of properties, as I define it,
>> so your "Unacceptable"s mean little to me. Of course if the syntax
>> limitations of a property implementation vis-a-vis direct manipulation of a
>> data value is unacceptable to you, then you just wouldn't use it.

OvdS> Don't you agree that string& name =; name.size() is kinda
OvdS> ugly/unusable compared to just>size() (possible) or
OvdS> (not possible, but ideal)?

First case (i. e.>size()) I already implemented in my version
of properties. Properties supports several access interfaces:

1. Like regular datamembers:
string str =;

2. Similar to smart pointers:
string str = *;

3. Function-call like syntax:
string str =;

4. set/get syntax:
string str =;

5. Member-access interface:
size_t sz =>size();

Last for cases breaks traditional datameber access inteface. But!
During regular usage in live project it does not matter. I mean that
properties (in such implementation) are another kind of the class
interface. Your are always keeping in mind (almost automatically) what
such kind of member in the public class interface is not usual
datamember and can have specific access rules. It is simple. :)

Best Regards,
 Sergey                          mailto:flex_ferrum_at_[hidden]

Boost list run by bdawes at, gregod at, cpdaniel at, john at