virtualized function - is that something along the lines of a constructor. that
is, a variable initializing a class
[EMAIL PROTECTED] wrote: i found a better answer in complete reference
(latter on :) ), it said we
cant use a less restrictive (private here) specifier in derived class then
the base class. its in oop principle, so this kind of examples are on the
responsibility of programmer cause c++ is weakly checked language ( we all
know that it is on the cost of more disciplined programmer :) ).
so it is not at all opp so its not a violation
(i got this answer latter so i am sharing with u all i was not intended to
take any kind of test or give any challenges)
On 7/8/07, Brett W. McCoy <[EMAIL PROTECTED]> wrote:
>
> On 7/7/07, Pedro Izecksohn <[EMAIL PROTECTED] <izecksohn%40yahoo.com>>
> 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
>
>
--
(¨`·.·´¨)
`·.¸(¨`·.·´¨) Keep
(¨`·.·´¨)¸.·´ Smiling!
`·.¸.·´ S H I S H I R S H A R M A 'Criss'
----------------------------------------------------------
"Don't Quit"
...and whats life without an impossible dream...
----------------------------------------------------------
[EMAIL PROTECTED]
[Non-text portions of this message have been removed]
---------------------------------
Need a vacation? Get great deals to amazing places on Yahoo! Travel.
[Non-text portions of this message have been removed]