Click here to Skip to main content
12,830,888 members (49,508 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 16:21pm
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!
pwasser 12-Sep-12 2:12am
Could you provide the actual code?
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:
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

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

Solution 1

See Member Visibility[^] in the MSDN.
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
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.170326.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2017
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