[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ Blues.



Hi,

>
> >I am not sure that is the case, however at the same time I am sure that
> >Stroustrup, et al did this for a good reason, if indeed this behavior is
> >in the standard. I have been unable to find anything on the topic in his
> >book "C++ Programming Language" 3rd Edition.
>
>
> Actually it's useful for things like:

Not really. See below.

>
> Class A {public: void foo(){/* something interesting */};

void foo(int){};

>};
> Class B :
> public Class A {private void foo(); /* don't want A::foo() public in Class
> B*/};
>

Nice try. But you also lost A::foo(int). Shadowing A::foo(void) is nice, but  
loosing A::foo(int) int the process is plain stupid, and is the problem the  
original poster had.

Or maybe I missed something in your post.

Cheers,

--fred