Click here to Skip to main content
12,304,652 members (65,038 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C++ WinRT
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 11-Sep-12 15:21pm
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!
pwasser 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.
Mohibur Rashid 12-Sep-12 4:05am
   
I found that code. Its in animate.h file line 40. but the project didnt opened in my machine because of old version(mine). and it is defined as

protected private:

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

See Member Visibility[^] in the MSDN.
  Permalink  
Comments
pwasser 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160530.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100