C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Derived class's function invokes base class's function

From: Chris Ryan <chrisr98008_at_[hidden]>
Date: Wed, 6 Apr 2022 09:26:30 -0700
Frederick Virchanza Gotham, I understand your request but extending the
implementation does not take into account the many other cases of expanding
the base functionality.

You propose covering this case:
void Derived::Method()
{
    Base::Method();
    //post-process
}

But what about this case:
void Derived::Method()
{
    //pre-process
    Base::Method();
}

Or this case:
void Derived::Method()
{
    //pre-process
    Base::Method();
    //post-process
}

You are proposing hidden automatic functionality.
Drilling down first is not always the answer.
I prefer explicit functionality.

Chris++;

On Wednesday, 6 April 2022 08:34:55 PDT Frederick Virchanza Gotham via Std-
> Proposals wrote:
> > I think we should have a way of getting the method in the Derived
> > class to automatically invoke the base class's method. So instead of
> > having:
>
>

Received on 2022-04-06 16:26:43