POV-Ray : Newsgroups : povray.programming : C++ inheritance puzzler : Re: C++ inheritance puzzler Server Time
16 Apr 2024 14:52:51 EDT (-0400)
  Re: C++ inheritance puzzler  
From: Thorsten Froehlich
Date: 27 Nov 2010 09:03:54
Message: <4cf10fca$1@news.povray.org>
On 27.11.10 15:00, clipka wrote:
> Hacking happily along at the POV-Ray code, I stumbled across this MS Visual
> Studio 2005 C++ anomaly:
>
> class A
> {
> protected:
> void a() {}
> };
>
> class B : public A
> {
> protected:
> void b(A* other)
> {
> this->a(); // (1)
> other->a(); // (2)
> }
> };
>
> While (1) compiles fine, (2) raises an error C2248, "'A::a' : cannot access
> protected member declared in class 'A'"
>
> What the F*** am I doing wrong here?

SP1 installed?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.