Boost logo

Boost :

Subject: Re: [boost] [string_ref] string literal constructor
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2013-11-07 17:59:43


On 8/11/2013 11:27, Quoth Nevin Liber:
> On 7 November 2013 16:00, Gavin Lambert <gavinl_at_[hidden]> wrote:
>> The first example in particular actually seems potentially dangerous to
>> me, because the ability to handle the non-terminated string is "hidden",
>> making it more likely that the author would forget and pass s to something
>> else that's expecting a terminated string.
>
> How does that differ from anything else that uses a C string?
>
> I just don't see how string_ref is any worse.

The current version of string_ref is not any worse. What we're
discussing here is a possible extra constructor, which I am saying is
potentially useful but possibly too dangerous to be worthwhile.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk