
On 10 March 2012 13:58, Olaf van der Spek <ml@vdspek.org> wrote:
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?
Have a look at http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/.
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
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Jeroen