|
Boost : |
Subject: Re: [boost] Heads up - string_ref landing
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-11-16 09:25:00
On 16/11/12 15:13, Yanchenko Maxim wrote:
>
>
> 16.11.12, 17:30, "Mathias Gaunard" <mathias.gaunard_at_[hidden]>":
>>
>> On 16/11/12 11:43, Olaf van der Spek wrote:
>>
>>> I'd like this to work:
>>> void f(str_ref);
>>>
>>> f("Olaf");
>>
>> It definitely needs to work, otherwise string_ref is useless.
>> The whole point is that it should behave like std::string but avoid
>> useless copies.
>
> If this is all you need, just use plain references.
void f(std::string const&);
f("Olaf");
does make a useless copy.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk