Boost logo

Boost :

Subject: Re: [boost] Heads up - string_ref landing
From: Olaf van der Spek (ml_at_[hidden])
Date: 2012-11-19 07:49:46


On Mon, Nov 19, 2012 at 4:42 AM, Yanchenko Maxim
<maximyanchenko_at_[hidden]> wrote:
> Mathias, it's not just compile-time size (which is good to have as well, btw).
> What about literals with a zero character inside, like "foo\0bar"?

What about them?
Such literals aren't proper null-terminated strings, are they?

> I believe string_ref should be able to handle the case, in order to be useful.

For such literals the (const char*, size_t) constructor should be used.

-- 
Olaf

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