Open redboltz opened 5 years ago
When I use boost::type_erasure::any<...>
, especially as the member of the container, I got annoying outputs as follows:
boost::type_erasure::any_constructor_control<boost::type_erasure::any_constructor_impl<boost::mpl::vector<boost::type_erasure::copy_constructible<boost::type_erasure::_self>, has_foo<void () const, boost::type_erasure::_self>, has_get<int () const, boost::type_erasure::_self>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::type_erasure::_self>, void>> = {
<boost::type_erasure::any_constructor_impl<boost::mpl::vector<boost::type_erasure::copy_constructible<boost::type_erasure::_self>, has_foo<void () const, boost::type_erasure::_self>, has_get<int () const, boost::type_erasure::_self>, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, boost::type_erasure::_self
This PR suppress the annoying outputs and print the address of the data that is owned by boost::type_erasure::any<...>
.
User can cast the address as the actual type. Gdb can't get the actual type because type is erased. So user needs to do try and error the possible types. I think that it is good enough.
Just print the address of actual data.
You can get outputs as follows:
If you know the acutual type, then you can cast as follows: