Skip to content

Creating a pro::proxy_view from a pro::weak_proxy #351

@jeanga

Description

@jeanga

Hi!

My question is about the process of proxy_view creation from a weak_proxy.

My (pseudo) code:

struct Identity : pro::facade_builder
    /// Conventions go here
    ::template add_skill<pro::skills::as_weak>
    ::template add_skill<pro::skills::as_view> 
    ::build
{
};

pro::proxy_view<Identity> as_view(const pro::weak_proxy<Identity>& type)
{
    if (type)
        return type.lock();
    return {};
}

My understanding is that this code will create a temporary pro::proxy just to create the pro::proxy_view before being deleted. Is that correct ?

Has the weak_proxy enough information to check it's expiration and directly create the view?

Again (and again) thank you for your hindsight!
Jean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions