Re: Confused about non-virtual functions

Discussion in 'C++' started by David Cattarin, Jun 24, 2003.

  1. Robert William Vesterman <> wrote in message news:<>...
    > I'm confused about the purpose of non-virtual functions. As I
    > understand it, if you have a class E that extends a class B and
    > overrides a non-virtual function f(), then the f() that actually gets
    > called for an E object depends upon whether that E object is known as
    > an E or as a B at the time of the call.
    >
    > I don't understand what's useful about this ambiguity in what the f()
    > of an E is. Could someone please give me an example of why it would
    > be useful?

    [snip]

    The main situation where this is used is with operator=. There are
    serious problems with making this virtual (think about signatures).

    Dave
    David Cattarin, Jun 24, 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. Victor Bazarov
    Replies:
    18
    Views:
    2,607
    David Cattarin
    Jun 27, 2003
  2. David White
    Replies:
    11
    Views:
    3,657
    Alexander Terekhov
    Jun 27, 2003
  3. tom_usenet
    Replies:
    0
    Views:
    872
    tom_usenet
    Jun 24, 2003
  4. Michael Winter
    Replies:
    9
    Views:
    616
    Michael Winter
    Sep 24, 2003
  5. John Goche
    Replies:
    10
    Views:
    741
    Marcus Kwok
    Dec 8, 2006
Loading...

Share This Page