Article

One way of thinking about access specifiers in C++/WinRT implementation types

The Old New Thing ·The Old New Thing ·Published 2026-10-09 ·5 min read

This 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


Discovered 2026-10-12 Source The Old New Thing Archive 2026-10 → c++winrtaccess-specifiers