Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2002-08-30 10:42:37


From: Carlo Wood <carlo_at_[hidden]>
> On Fri, Aug 30, 2002 at 03:54:20PM +0200, Thomas Witt wrote:
> > > void demangle_type(std::string & t_o, std::string const & t_i);
> > > void demangle_symbol(std::string & s_o, std::string const & s_i);
> >
> > Take my apologies for the possibly dumb question, but what's wrong with
> >
> > std::string demangle_type(std::string const & t_i);
>
> The function appends its data to the string.

That's hardly a requirement for demangling functionality.

> This allows to 'construct' a string without unnecessary
> need to copy strings.
>
> For example:
>
> std::string out = "You are inside ";
> demangle(out, mangled_function_name);

That presumes the caller wants to create a string to pass to the
function, of course. That same thing can be done like this:

std::string out = "You are inside ";
out += demangle(mangled_function_name);

(if we can resolve the memory allocation aspects).

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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