Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: pure virtual functions as non-const in derived classes

Reply
Thread Tools

Re: pure virtual functions as non-const in derived classes

 
 
jeffc
Guest
Posts: n/a
 
      08-27-2003

"Victor Hannak" <(E-Mail Removed)> wrote in message
news:biinpb$i81$(E-Mail Removed)...
> All the documentation I have looked through (the FAQ, textbooks) all show
> pure virtual functions declared as const.
>
> Is there anything wrong with instantiating a non-const pure virtual
> function?


No.

> Why doesn't any of the documentation have examples like this?


I seriously doubt there isn't an example in "any of the documentation".

> I understand why the definition of the pure virtual function in the ABC is
> const. After all, it can't/shouldn't do anything in the ABC.


It can indeed, if it is called from a base class.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Derived::Derived(const Base&) and Derived& operator=(const Base&) developereo@hotmail.com C++ 1 05-23-2007 12:07 AM
Wrapping classes with pure virtual functions gabriel.becedillas@gmail.com Python 3 12-17-2006 06:14 PM
private virtual functions and pure virtual functions with bodies John Goche C++ 10 12-08-2006 04:00 PM
redeclaring (pure) virtual functions in derived classes? Steven T. Hatton C++ 5 05-22-2005 11:53 PM
Re: pure virtual functions as non-const in derived classes Gianni Mariani C++ 2 08-27-2003 09:57 PM



Advertisments