Skip to content

Check presence of observers and validators in owner #9

@SylvainCorlay

Description

@SylvainCorlay

In xproperty.hpp, properties call methods on the owner.

    template <class T, class O, class D>
    template <class V>
    inline auto xproperty<T, O, D>::operator=(V&& value) -> reference
    {
        m_value = owner()->template invoke_validators<derived_type>(std::forward<V>(value));
        owner()->notify(derived_cast());
        owner()->template invoke_observers<derived_type>();
        return m_value;
    }

If we check that the methods exist at compile time and only call them if it is the case, we can prevent the requirement on the owner to have certain methods.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions