cschreib/observable_unique_ptr

Missing explicit cast constructor for observer from observable

Closed this issue · 1 comments

Currently if I want to create a downcasted observer from an observable, I have to create an intermediate observer pointer of the same type as the observable then create my downcast observer from that base observer.

That is, currently this does not work:

class A {};
class B : A {};

//assume this is holding a B*
oup::observable_unique_ptr<A> a;
oup::observer_ptr<B> b{a, dynamic_cast<B*>(a.get())};

but instead requires a temporary observer_ptr of type A as an intermediate to get the observer_ptr of type B.

Thank you for reporting this problem. It has been fixed in #13, and the fix is included in the new v0.7.0 release.