Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2002-08-30 11:27:58


From: Carlo Wood <carlo_at_[hidden]>
> On Fri, Aug 30, 2002 at 11:42:37AM -0400, Rob Stewart wrote:
> > 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);
>
> But that would add an additional copy
> of the demangled name.

Yep. There's no problem there. Really. We're talking about
diagnostic code here. Performance isn't an issue.

Besides, that same interface permits other uses like others have
posted already:

   std::cout << demangle(mangled_function_name) << std::endl;

Your approach requires the creation of a named temporary and an
awkward calling sequence. (Yes, I recall that you discussed a
wrapper that provides that interface, but there's no need for the
wrapper as demangle() doesn't need to be performance conscious.)

-- 
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