[Boost-bugs] [Boost C++ Libraries] #9069: boost::to_string(boost::original_exception_type) needs demangling

Subject: [Boost-bugs] [Boost C++ Libraries] #9069: boost::to_string(boost::original_exception_type) needs demangling
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-08-30 13:42:46


#9069: boost::to_string(boost::original_exception_type) needs demangling
------------------------------+----------------------------
 Reporter: sarum9in@… | Owner: emildotchevski
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: exception
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
------------------------------+----------------------------
 Header: boost/exception/detail/exception_ptr.hpp

 Current definition of original_exception_type is
 {{{
 typedef error_info<struct tag_original_exception_type,std::type_info const
 *> original_exception_type;
 }}}

 It uses std::type_info to store original type.


 Current definition of to_string is
 {{{
     inline
     std::string
     to_string( original_exception_type const & x )
         {
         return x.value()->name();
         }
 }}}

 to_string() returns std::type_info::name() without demangling, so user
 gets type name like "St13runtime_error". It would be better to get
 "std::runtime_error".

 I suggest using
 {{{
     inline
     std::string
     to_string( original_exception_type const & x )
         {
         return units::detail::demangle(x.value()->name());
         }
 }}}

 units::detail::demangle() is already used in boost::exception library, so
 no new dependency is introduced.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9069>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC