C++ Logo

sg10

Advanced search

Re: [SG10] P0272: non-const string data

From: Nevin \ <"Nevin>
Date: Fri, 11 Mar 2016 19:13:44 -0600
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

Received on 2016-03-12 02:13:51