Reputation: 233
In some of the .h files in the XAML SwapChainPanel DirectX interop sample, members are declared as protected private.
How is this different from just protected or just private?
Upvotes: 1
Views: 385
Reputation: 355049
See Namespaces and Type Visibility (C++/CX) in the documentation. There is a table entitled Member accessibility and visibility that explains the different access modifiers. Specifically,
protected private or private protected: Not visible in metadata; protected accessibility within the app or component.
You'd use this when you want a member to be protected so that you can access it from derived classes defined within the same module, but you do not want the member to be present in metadata. Things that are not present in metadata cannot be used across the ABI.
When is this useful? The Ref classes and structs (C++/CX) page in the documentation explains that...
Standard C++ types must have private, internal, or protected private accessibility, which prevents them from being emitted to metadata.
So, the primary use of protected private is if you want a protected member that uses C++ language features that cannot be used at the ABI. The two linked documentation pages, and the rest of the C++/CX documentation, contain more relevant information.
Upvotes: 5