C++ Logo

std-proposals

Advanced search

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

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Wed, 6 Apr 2022 12:55:44 -0400
See also
https://quuxplusone.github.io/blog/2019/12/03/dress-shirt/

On Wed, Apr 6, 2022 at 12:26 PM Chris Ryan via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> 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:
>>
>> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2022-04-06 16:55:56