member overridding

From: Dan Moos (dan.moos_at_verizon.net)
Date: 03/08/04


Date: Mon, 08 Mar 2004 06:39:53 GMT

To anyone tired of dealing with my confusion on this matter, I apologize.

Okay, I'm still a little curious about the effects of overridding a
non-virtual member function. Many of you have said "why do I want to do
this, if I don't want polymorphic behaviour"

Here it is in a nutshell. I have a base class with a static member function.
I want to derive from this class. I also want to override the static member
function. I will never deal with an object of the derived class through a
pointer to the base class (no polymorphic behaviour wanted, no virtual
functions needed). Really the only reason I want to derive from this class
is to save work. The base class creates a very simple barebones appplication
framework for a certain O.S. (win32). The derived classes will be taylored
to create more usefull, more specific app frameworks. I really only want to
use inheritance because it will save me the trouble of coding the parts of
the derived classes that is common with the base class.

Anyway, I tried overridding my static member in a simple test class derived
from the base. It appears to works as I intended, calling the correct
version of the static function. Yet I keep hearing that you can't override
non-virtual funtions.

Am I causing undefined behaviour that just "appears" to work, or am I
mis-understanding you folks (highly likely!!)

help!!!



Relevant Pages

  • Re: member overridding
    ... I have a base class with a static member function. ... I tried overridding my static member in a simple test class derived ... Comeau C/C++ with Dinkumware's Libraries... ...
    (alt.comp.lang.learn.c-cpp)
  • Re: member overridding
    ... I have a base class with a static member function. ... >the derived classes that is common with the base class. ... I tried overridding my static member in a simple test class derived ...
    (alt.comp.lang.learn.c-cpp)
  • Re: interface mapping
    ... the point was about member hiding, ... Your example still shows that DerivedClass can't ... "Member hiding is not the reason because the base class should fulfill ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Problem with inheritance and tamplates
    ... your code is a template argument dependant name, ... of a base class that is dependent on a template argument. ... You need to tell the compiler it is a member name, ...
    (comp.lang.cpp)
  • Re: Help!!! I give up...Confused!
    ... It is against my will to post such a lenghty problem, ... It must have something to do with the way my objects are declared which renders my base class to forget the value of one of its members. ... //Set FLAG_AllTrueInCase to true if FLAG_AllTrueInCase //and bCondTrue equals to true else set it to false. ... What must I do to keep the component's member value as static. ...
    (microsoft.public.vc.language)