C++ Logo


Advanced search

Re: [SG10] [isocpp-core] Feature-test macro for ADL calls with template arguments?

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Mon, 8 Jun 2020 18:56:37 +0300
On Mon, 8 Jun 2020 at 18:49, Marek Polacek <polacek_at_[hidden]> wrote:
> On Mon, Jun 08, 2020 at 12:02:28PM +0300, Ville Voutilainen via Core wrote:
> > P0846 gives us the ability to do ADL for calls to function templates with
> > explicit template arguments provided. Did we get a feature-testing macro
> > for it?
> Doesn't seem that we have it.

For a rationale to consider having it: I have users who would like to
write ADL-only structured bindings
customization points and also allow them to be called with ADL calls;
library folks call this a "hidden friend".
When the macro is not defined, the fallback code would expose the
customization point (or not provide
it at all), but when it's defined, the customization point would be a
hidden friend. Structured bindings seem to be able
to call it anyway, but user code can't, before the language fix is implemented.

Received on 2020-06-08 10:59:56