__invoke_impl - - Dereference the pointer

Jonathan Wakely jwakely@redhat.com
Mon Jan 19 16:21:55 GMT 2026


On Mon, 19 Jan 2026 at 16:10, Frederick Virchanza Gotham
<cauldwell.thomas@gmail.com> wrote:
>
> On Mon, Jan 19, 2026 at 1:13 PM Tomasz Kaminski wrote:
> >
> > The current implementation of std::invoke(f, t) support situation when t is
> > smart_pointer (shared_ptr, unique_ptr, but also anything with operator*),
> > and this is required per standard.
> >
> > As none of standard defined smart pointers (and I except user defined ones)
> > overloads operator->*, your proposed alternative will break their support,
> > and be non-confiroming.
>
>
> Thanks for that.
>
> Here's what I'm thinking is best to do, always try to use "->*" but
> fall back to using "(* ).*, as follows:

There is no measure by which this is "best to do". It would be wrong,
and is not going to happen.



More information about the Libstdc++ mailing list