C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::chimeric_ptr -- it's alive... it's ALIVE!

From: Andre Kostur <andre_at_[hidden]>
Date: Fri, 21 Nov 2025 11:33:25 -0800
As has been stated multiple times: an implementation is not a
specification. As a result, I have no way of verifying that the
compiler-explorer implementation is "working" as I'm suggesting that
the specification is unclear as to what "working" is. And I'd like to
see the specification discuss the decision of matching the first-named
class vs. failing to compile should it find two. Or, if it does find
two, does it work out to be an overload set where the arguments passed
to the function call would be sufficient to disambiguate the call?
Should that still only find the first match and thus fail because the
arguments I passed would have caused it to use the second function
found?

On Fri, Nov 21, 2025 at 11:11 AM Frederick Virchanza Gotham
<cauldwell.thomas_at_[hidden]> wrote:
>
> 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.

Received on 2025-11-21 19:33:39