INIT_NOTIFYING_PROPERTY should qualify its access to m_propertyChanged
@dunhor is already working on this.
Since Jul 28, 2026.
- Dominant language
- C++
- Stars
- 3k
- Forks
- 300
- Avg merge
- 19h 12m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.