Filing this as a follow up to #657. Will submit a PR once that one is merged.
TL;DR, the intended usage is something like:
struct foo : winrt::implements<...>, wil::notify_property_changed_base<foo>
{
wil::single_threaded_notifying_property<int> MyProperty;
Test() : INIT_NOTIFYING_PROPERTY(MyProperty, 42) {}
};
This has a problem if foo is a class template since notify_property_changed_base uses CRTP. E.g. now consider:
template <typename T>
struct foo : winrt::implements<...>, wil::notify_property_changed_base<foo<T>>
{
wil::single_threaded_notifying_property<int> MyProperty;
Test() : INIT_NOTIFYING_PROPERTY(MyProperty, 42) {}
};
notify_property_changed_base is now dependent on the template argument T and therefore name lookup won't "look inside" of notify_property_changed_base when trying to resolve unqualified names. Since m_propertyChanged is a member of notify_property_changed_base, access needs to be prefixed with something like this-> for proper two phase name lookup to resolve the name correctly.
Filing this as a follow up to #657. Will submit a PR once that one is merged.
TL;DR, the intended usage is something like:
This has a problem if
foois a class template sincenotify_property_changed_baseuses CRTP. E.g. now consider:notify_property_changed_baseis now dependent on the template argumentTand therefore name lookup won't "look inside" ofnotify_property_changed_basewhen trying to resolve unqualified names. Sincem_propertyChangedis a member ofnotify_property_changed_base, access needs to be prefixed with something likethis->for proper two phase name lookup to resolve the name correctly.