Boost logo

Boost :

Subject: Re: [boost] [property] interest in C# like properties for C++?
From: Olaf van der Spek (olafvdspek_at_[hidden])
Date: 2009-10-24 08:05:18

On Sat, Oct 24, 2009 at 4:11 AM, Bo Persson <bop_at_[hidden]> wrote:
>> Don't you agree that string& name =; name.size() is kinda
>> ugly/unusable compared to just>size() (possible) or
>> (not possible, but ideal)?
> I might be stupid here, but can not see any advantage at all for using
>>size() over the traditional

Since references can't be rebound, I'm using a pointer to store the
actual value. So the first syntax doesn't require any modification of
call sites.
The first one looks more natural to me without the ().

> And why is the "ideal" c.cname.size(), should it not be
> with size being a property of the string?

Yes, if std::string::size indeed becomes a property. That's unlikely
to happen any time soon though. :(


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