microsoft / microsoft/wil

INIT_NOTIFYING_PROPERTY should qualify its access to m_propertyChanged

Open
#659 0 comments 0 reactions 1 assignee View on GitHub

@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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.