Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-09-04 05:39:41


From: "Carlo Wood" <carlo_at_[hidden]>
>
> That, combined with the fact that the origin of the mangled names
> are char const* to begin with, I see only one general interface
> that makes sense:
>
> namespace boost {
>
> template<typename Allocator>
> struct demangler {
> static std::basic_string<char, std::char_traits<char>, Allocator>
> type(char const* in);
> static std::basic_string<char, std::char_traits<char>, Allocator>
> symbol(char const* in);
> };
>
> }

Note that there is one more problem awaiting. Allocator is a concrete type -
std::allocator<char> for instance - but I got the impression that you'll
need to use it to define temporary std::vector's etc with a value_type that
is not char. This means that you'll have to use the "rebind" member of the
Allocator and this is certainly going to create problems on some compilers.

What is wrong with the "to the metal"

extern "C" int demangle_type_impl(char const * type, char * out, size_t
out_len, char * workarea, size_t workarea_len);

+ C++ style "for the rest of us"

std::string demangle_type(std::string type);


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