Click here to Skip to main content
15,918,303 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Yesterday I was practicing my rusty C++ and trying to learn DirectX on Windows 8.
One of the (WinRT, C++/CX) sample had a class like that

ref class A
private protected:
 int num;

Now I'm confused.. what is this 'private protected' thing?
I know protected (only accessible to subclass) or private (accessible to no one else), but what of 'private protected'????
Mohibur Rashid 11-Sep-12 21:29pm    
does this compile at all? it does not in my machine.

if it is

then it make sense.
lewax00 11-Sep-12 23:10pm    
I have to agree with Mohibur, that doesn't look valid. It's probably a typo (but if it does compile...then it's very interesting because it's the first I've heard of it).
Super Lloyd 11-Sep-12 23:48pm    
I don't have windows 8 at work but....

I just checked the MSDN sample from (which I did compile and run at home):

In C++\DirectXBase.h:40 => "protected private:"
And it compiles and run!
[no name] 12-Sep-12 2:12am    
Could you provide the actual code?
Jochen Arndt 12-Sep-12 4:13am    
See here:
If the code is not shown, select Lesson1 - DirectXBase.h on the left side.

1 solution

See Member Visibility[^] in the MSDN.
Share this answer
[no name] 12-Sep-12 4:27am    
Beat me.
Jochen Arndt 12-Sep-12 4:30am    
By less than a minute.
Mohibur Rashid 12-Sep-12 4:42am    
Super Lloyd 12-Sep-12 4:52am    
Ho this is a new C++/Cx thing, cool!
Thanks for this complete answer! :)
Jochen Arndt 12-Sep-12 4:56am    
It was new to me too. But not so new when introduced with VS 2005.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900