
23 Mar
2017
23 Mar
'17
7:57 a.m.
On Wed, Mar 22, 2017 at 11:38 PM, Gavin Lambert via Boost
On 23/03/2017 03:28, Olaf van der Spek via Boost wrote:
void f2(const string&); string f1();
f1(f2());
Isn't this a very common pattern?
Yes (although you have it reversed), but that's not what we were talking about.
It's the same underlying issue, replacing const string& by string_view doesn't change it.
We were talking about this:
void f1(const string_ref&); string f2();
f1(f2());
Or this:
void f1(const string_ref&);
AFAIK string_ref should be passed by value, not by const&. -- Olaf