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

Discussion in 'C++' started by jeffc, Aug 27, 2003.

  1. jeffc

    jeffc Guest

    "Victor Hannak" <> wrote in message
    news:biinpb$i81$...
    > 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.
     
    jeffc, Aug 27, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gianni Mariani
    Replies:
    2
    Views:
    510
    Gianni Mariani
    Aug 27, 2003
  2. Steven T. Hatton
    Replies:
    5
    Views:
    1,004
    Steven T. Hatton
    May 23, 2005
  3. Replies:
    1
    Views:
    411
    myork
    May 23, 2007
  4. Replies:
    1
    Views:
    399
    Victor Bazarov
    May 23, 2007
  5. reppisch
    Replies:
    6
    Views:
    415
    Andrey Tarasevich
    May 6, 2008
Loading...

Share This Page