Skip to content

Missing explicit cast constructor for observer from observable #12

Closed
@HK47196

Description

@HK47196

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions