On 7/7/07, Pedro Izecksohn <[EMAIL PROTECTED]> wrote:
> > I don't see how this is a "violation of OOP". You are asking a public
> > member of the base class to execute a virtualized function - virtual
> > base class functions call the most derived function of same name and
> > parameters. Most implementations use a vtable...whatever address the
> > function points at is the one that gets called. It seems that you are
> > asking for runtime checking of sections, which would most likely result
> > in a huge performance hit. If you want the function only available to
> > derived classes, then it should be declared in a 'protected:' section in
> > the base class. If you need it public in some classes and private in
> > others, you can change the section type via a derived class. That will
> > move checking of section types to compile-time and not affect runtime
> > performance.
>
> I understand Shishir feelings as the similar Java example below is refused
> by the compiler. For reasons like this I prefer to program in Java whenever
> possible.
That's a pretty silly reason, IMHO...
-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
If I were to divulge it, it would overturn the world."
-- Jelaleddin Rumi