User Profile

Collapse

Profile Sidebar

Collapse
herlands
herlands
Last Activity: Aug 6 '07, 11:01 AM
Joined: May 9 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • herlands
    replied to Accessing overridden base methods/functions
    in C
    Hi again :) Thank you both for your replies!

    I have tried to use the [code=c] using Base::doSomethi ng; [/code] but I can't get it to solve the problem. The reason I am deriving this class is that it is a precompiled object that has a lot of calls to it, and I want to add some preconditions ( am I right? ) to the Base functions. In other words the Base functions is used as post-condition in the Derived. I have done this with success...
    See more | Go to post

    Leave a comment:


  • herlands
    replied to Accessing overridden base methods/functions
    in C
    Thank you for your swift reply, Darryl!

    Do you know of any case that would make Base::doSomethi ng invisible when overridden even though it is not a virtual func?

    I am deriving from a precompiled object and the following example works as expected:

    Code:
    class Derived : public Base
    {
    	public:
    	void doSomethingExtra()
    	{
    		//something something...
    		Base::doSomething();
    ...
    See more | Go to post

    Leave a comment:


  • herlands
    started a topic Accessing overridden base methods/functions
    in C

    Accessing overridden base methods/functions

    Hi!

    Given the following example:
    Code:
    class Base
    {
    public:
    	void doSomething()
    	{
    		//Something...
    	}
    };
    
    class Derived : public Base
    {
    public
    	void doSomething()
    	{
    		// Something else...
    		Base::doSomething();
    	}
    };
    
    int main()
    {
    	Derived d;
    	d.doSomething();
    	return
    ...
    See more | Go to post
No activity results to display
Show More
Working...