Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Handle-type-casting-tp11733p11736.html
On Thu, 2008-02-28 at 13:06 +0000, Simon Ibbotson wrote:
> If you have a handle to any Observable - Handle<T1> but you need a
> handle to a derived type Handle<T2>, I can find no way of currently
> doing this without going through the process of
> a) Getting the underlying boost::shared_ptr<T1>
> b) Using boost::dynamic_pointer_cast to get a boost::shared_ptr<T2>
> c) Creating a Handle<T2> using the new shared_ptr<T2>.
>
> Unfortunately, this means that if the original Handle<T1> points to a
> new object, the Handle<T2> does not point to this updated object.
Ok. Let's say you keep the Handle<T2> connected to the original Handle.
What happens if the new object is not a T2?
Luigi
--
Better to have an approximate answer to the right question than a
precise answer to the wrong question.
-- John Tukey as quoted by John Chambers
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev