Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: A TC++PL pr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 9539 of 9830
Post > Topic >>

Re: A TC++PL protected class question

by "stevendaiy" <stevendaiy@[EMAIL PROTECTED] > Apr 26, 2008 at 04:26 PM

"stevendaiy" <stevendaiy@[EMAIL PROTECTED]
> wrote in message
news:3pqdnT01eYcgGZLVnZ2dnUVZ_smnnZ2d@[EMAIL PROTECTED]
> My first question is that: isn't Y2 a member of Z2 (aka base class), so
> that
> access to X from Y2 is solely based on the relations between Y2 and X.
> I think it's equivalent to
> void Y2::g(Y2 *py2)  //notice Y2:: not Z2::
> {
>   X* px = py2; //OK
> }
>
> My second question is that the above two sets of code BOTH compile under
> Microsoft VS 2003 and cygwin. It could be a compiler issue though.
>

I should also add that if my observation is correct, it means that either
there
is an error in the example in the book of TC++PL or two of the most used
compilers are wrong.
I really appreciate if someone could go through the example in TC++PL as
shown in the email and verify them independent using any compiler.

Thanks.
Steven



-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 4 Posts in Topic:
A TC++PL protected class question
"stevendaiy" &l  2008-04-24 01:03:00 
Re: A TC++PL protected class question
"stevendaiy" &l  2008-04-26 16:26:34 
Re: A TC++PL protected class question
"Bo Persson" &l  2008-04-27 07:12:20 
Re: A TC++PL protected class question
"stevendaiy" &l  2008-04-28 16:06:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 15:37:52 CDT 2008.