One way of thinking about access specifiers in C++/WinRT implementation types
cppdashboard.dev/r/2026/10/one-way-of-thinking-about-access-specifiers-in-cpp-winrt-impThis article discusses how access specifiers in C++/WinRT implementation types can be interpreted based on their visibility to the outside world and the module that produces them.
From the article
In C++/WinRT, Windows Runtime classes are exposed to the outside world through the projection, but internally they are represented by their implementation type. Since the outside world sees only the projection, implementation types are visible only to the module that produced them.
This realization lets you reinterpret the C++ access specifiers for C++/WinRT implementation types.
struct Widget : winrt::implements<Widget, IStringable> { public: // This is a member of IStringable, // so it is accessible to anyone. winrt::hstring ToString(); // This does not implement any member from IStringable, // so it is accessible to other code in the same module. void Recolor(winrt::Windows::UI::Color newColor); protected: // Accessible to implementation classes that derive from Widget. void…
Share this resource