Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Re: Confused about non-virtual functions (http://www.velocityreviews.com/forums/t267661-re-confused-about-non-virtual-functions.html)

David Cattarin 06-24-2003 01:51 PM

Re: Confused about non-virtual functions
 
Robert William Vesterman <bob@vesterman.com> wrote in message news:<ca2ffv0nshh91iibbihief64sothge3c4d@4ax.com>. ..
> 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


All times are GMT. The time now is 07:30 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.