Date: Fri, 21 Nov 2025 19:13:00 +0000
On Fri, Nov 21, 2025 at 7:05 PM Andre Kostur <andre_at_[hidden]> wrote:
>
> That's a choice: what were the considerations about behaving
> consistently with multiple inheritance where that becomes an ambiguous
> call and thus a compile-time error? The specification doesn't seem to
> clearly state that choice either. The specification did say "the
> compiler tries to find the member object/function in all of the base
> classes specified".
That GodBolt I gave you is working. Give it some more classes and see
how it behaves, and tell me what you think should happen differently.
You mentioned a compile-time error, but that just makes the feature
less versatile. I prefer "first class wins" because it gives you the
freedom to rearrange the order of the template parameters if you want
different behaviour.
>
> That's a choice: what were the considerations about behaving
> consistently with multiple inheritance where that becomes an ambiguous
> call and thus a compile-time error? The specification doesn't seem to
> clearly state that choice either. The specification did say "the
> compiler tries to find the member object/function in all of the base
> classes specified".
That GodBolt I gave you is working. Give it some more classes and see
how it behaves, and tell me what you think should happen differently.
You mentioned a compile-time error, but that just makes the feature
less versatile. I prefer "first class wins" because it gives you the
freedom to rearrange the order of the template parameters if you want
different behaviour.
Received on 2025-11-21 19:11:34
