|
From: Luigi B. <lui...@gm...> - 2008-02-28 13:30:36
|
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 |