[SG10] P0272: non-const string data

Jens Maurer Jens.Maurer at gmx.net
Fri Mar 11 23:02:14 CET 2016


On 03/11/2016 08:08 PM, Nelson, Clark wrote:
> The paper proposing a new overload for string::data didn't propose a
> feature-test macro.
> 
> The first question is, would one be useful for it?

For
   s.data()

the workaround is something like

   &s[0]

(Both const and non-const.)

For someone trying to be backward-compatible, I can't see
why you'd perform an #ifdef dance to be able to write
s.data().

Jens


More information about the Features mailing list