Click here to Skip to main content
15,885,141 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'????
Posted
Comments
Mohibur Rashid 11-Sep-12 21:29pm    
does this compile at all? it does not in my machine.

if it is
private:
protected:

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):
http://code.msdn.microsoft.com/windowsapps/Metro-style-DirectX-18f98448

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: http://code.msdn.microsoft.com/windowsapps/Direct2D-Image-Effects-2979be08/sourcecode?fileId=44788&pathId=48444729.
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
 
Comments
[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    
nice.
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