Subject: [Boost-bugs] [Boost C++ Libraries] #2398: Supply type info to debug hooks
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-10-09 17:49:24
#2398: Supply type info to debug hooks
--------------------------------------+-------------------------------------
Reporter: Jim Barry <jim_at_[hidden]> | Owner: pdimov
Type: Feature Requests | Status: new
Milestone: | Component: smart_ptr
Version: | Severity: Not Applicable
Keywords: |
--------------------------------------+-------------------------------------
I have found it very useful to have access to the type names of shared
objects for debugging purposes. May I suggest adding a type_info parameter
to the hook functions:
{{{
void sp_scalar_constructor_hook( void * px, std::size_t size,
std::type_info const & ti, void * pn );
void sp_scalar_destructor_hook( void * px, std::size_t size,
std::type_info const & ti, void * pn );
}}}
Then sp_counted_impl_p can call them like this:
{{{
explicit sp_counted_impl_p( X * px ): px_( px )
{
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
boost::sp_scalar_constructor_hook( px, sizeof(X), typeid(X), this );
#endif
}
virtual void dispose() // nothrow
{
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
boost::sp_scalar_destructor_hook( px_, sizeof(X), typeid(X), this );
#endif
boost::checked_delete( px_ );
}
}}}
Thanks!
-- Ticket URL: <http://svn.boost.org/trac/boost/ticket/2398> 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:49:58 UTC