
10 Mar
2012
10 Mar
'12
12:58 p.m.
On Sat, Mar 10, 2012 at 12:19 PM, Lars Viklund <zao@acc.umu.se> wrote:
On Fri, Mar 09, 2012 at 07:14:24PM +0100, g.fanini@gmail.com wrote:
Could I ask for a clarification whether boost::algorithm::trim_copy() behaves like "strdup" in normal C, i.e. does it allocate a new string ? or does it modify the passed string without allocating a new string ?
As the parameter is const, it cannot cast the const away to mutate it unless it knows things about the argument at the call site, which it cannot know.
Hmm, wouldn't a by-value parameter allow one to avoid the copy?
Also, you're using very ancient documentation there, are you really on 1.34 or just using the wrong documentation?
It's still the first hit on google... -- Olaf