![]() |
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.