Boost logo

Boost :

Subject: Re: [boost] [type_erasure] Review started (July 18-27, 2012), rebind_any bad_cast
From: Larry Evans (cppljevans_at_[hidden])
Date: 2012-07-25 11:57:26


On 07/18/12 00:13, Lorenzo Caminiti wrote:
> Hello all,
>
> *** The review of Steven Watanabe's proposed Boost.TypeErasure library
> begins on July 18, 2012 and ends on July 27, 2012. ***
>
The attached produces runtime error:

./rebind_any.exe
creating b_self
any(const U&)
creating b_copy
terminate called after throwing an instance of
'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::type_erasure::bad_any_cast>
>'
  what(): std::bad_cast
make: *** [run] Aborted

Yet, the type returned by rebind_any was used in the any_cast; hence,
it must be a good cast, AFAICT.

What am I doing wrong?

TIA.

-Larry




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