Re: How many bytes per Italian character?



"Alexander Grigoriev" <alegr@xxxxxxxxxxxxx> wrote in message
news:u0ERs%23feHHA.4916@xxxxxxxxxxxxxxxxxxxxxxx
You failed your interview.

You CAN implement pure virtual function. Your implementation will be used
when it's called from your class constructor or destructor.


Ah, thanks. Learn something new every day! :-)

But I don't know what advantage it is to have this obscure behavior. If a
fixed method is to be called from a constructor or destructor, there is no
reason to make it virtual and mislead the user of the class into thinking an
overridden one of the same name in a derived class will be called. Unless
there is some practical purpose for this (and by practical, I mean something
other than someone getting a PhD thesis from it), then I have to throw this
into the part of C++ that should not be used (along with most of the
esoteric usages of templates).

-- David


.



Relevant Pages

  • Re: How many bytes per Italian character?
    ... You CAN implement pure virtual function. ... when it's called from your class constructor or destructor. ... there is some practical purpose for this (and by practical, ...
    (microsoft.public.vc.mfc)
  • Re: How many bytes per Italian character?
    ... You CAN implement pure virtual function. ... when it's called from your class constructor or destructor. ... These things are the kind of intricacies and exceptions-to-rules that ...
    (microsoft.public.vc.mfc)
  • Re: How many bytes per Italian character?
    ... You failed your interview. ... when it's called from your class constructor or destructor. ... you can't implement a pure virtual function because by ...
    (microsoft.public.vc.mfc)
  • Re: clarification - calling virtual function from destructor
    ... >>The destructor here has undefined behavior because it's calling ... > But isn't the pure virtual function defined through class B? ... When you enter A's destructor B has already been destroyed, ...
    (comp.lang.cpp)

Loading