C++ Logo

SG10

Advanced search

Subject: Re: [SG10] P0272: non-const string data
From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2016-03-12 03:53:03


On 03/12/2016 02:13 AM, Nevin ":-)" Liber <Nevin :-) Liber wrote:
> On Mar 11, 2016, at 4:02 PM, Jens Maurer <Jens.Maurer_at_[hidden]> wrote:
>>
>> For
>> s.data()
>>
>> the workaround is something like
>>
>> &s[0]
>>
>> (Both const and non-const.)
>
> It's slightly worse:
>
> v.empty() ? nullptr : &v.front()

Thanks for the correction. I still think we don't need a macro
for a user to enable non-substantial syntactic sugar.

Jens


SG10 list run by herb.sutter at gmail.com