C++ Logo

SG10

Advanced search

Subject: Re: [SG10] P0272: non-const string data
From: Nevin \ (nliber_at_[hidden])
Date: 2016-03-11 19:13:44


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()

But other than that I agree you don't need a macro to test for it.

-- 
 Nevin ":-)" Liber <mailto:nevin_at_[hidden]>  +1-312-623-5420

SG10 list run by herb.sutter at gmail.com