C++ Logo

std-proposals

Advanced search

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

From: Jens Maurer <Jens.Maurer_at_[hidden]>
Date: Sat, 16 Apr 2022 00:43:11 +0200
On 15/04/2022 23.34, Frederick Virchanza Gotham via Std-Proposals wrote:
> On 4/15/22, Jason McKesson via Std-Proposals wrote:
>
>> Just to be clear, my point was not specifically about complexity added
>> to compilers. I was referring to complexity added to the *language*.
>>
>> First, you're overloading keywords with new functionality that is at
>> best marginally based on the literal text of the keyword. Just try to
>> explain to someone how "requires continue" relates to the usual
>> meaning of "requires" in that position of a function declaration.
>>
>> Second, it creates very strange control-flow dynamics, where the
>> presence of a keyword outside of the body of the function causes other
>> functions to be called when you call that function. That's similar to
>> calling constructors of subobjects, but it's still really bizarre (and
>> it doesn't use member initialization list syntax).
>
>
>
> People use words like 'strange', 'weird' and 'bizarre' as synonyms for
> 'new'. What I'm proposing is simply a new idea, something that hasn't
> been done before. Speaking in a very generic sense, humankind
> shouldn't be reluctant to make progress simply because of how we used
> to do things. For a long time I've thought that one of the most
> dangerous phrases in the English language is "because that's how we've
> always done it".
>
> Object-orientated programming was 'bizarre' at one point, but it
> caught on eventually. Maybe these new continuity methods I'm proposing
> will catch on too if people think they makes sense and they reduce
> work and reduce human error.

Let me make a rather bold prediction: this proposal won't go anywhere
unless you show convincing use-cases with "before" and "after" code
snippets so that "Maybe these new continuity methods [...] will catch
up too" turns into "These new continuity methods are so attractive we
should have put them into the standard a decade ago" for a large
majority of WG21 participants.

P0847R7 "Deducing this" was such a proposal.

The one we have here still needs substantial homework.

Jens

Received on 2022-04-15 22:43:15