C++ Logo

sg10

Advanced search

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

From: Barry Revzin <barry.revzin_at_[hidden]>
Date: Tue, 9 Jun 2020 10:14:58 -0500
On Tue, Jun 9, 2020 at 10:00 AM Ville Voutilainen <
ville.voutilainen_at_[hidden]> wrote:

> On Tue, 9 Jun 2020 at 17:49, Barry Revzin <barry.revzin_at_[hidden]> wrote:
>
> > Okay, but what would you do with the feature test macro if not:
> > #ifndef __cpp_adl_template_whatever
> > namespace voldemort::qt::lol { class get_tag { explicit get_tag(int); };
> }
> > template <typename T> void get(voldemort::qt::lol::get_tag );
> > #endif
> >
> > ?
>
> Why do I need to answer the same questions multiple times? Copy-pasting
> from
> https://lists.isocpp.org/core/2020/06/9295.php :
>
> struct MyTupleLike {
> #ifdef __cpp_adl_template_call
> // the definition of get<> as a hidden friend goes here};
> #endif
> };
>

> I find it rather plausible that a simplicity-seeking programmer will
> just not provide a structured-bindings
> interface that he also wants to allow calling via ADL outside
> structured bindings when an implementation
> of P0846 is not available.
>

I'm having trouble parsing this sentence. Is the claim that being unable to
write get<0>(e) is a reason for somebody to avoid opting into structured
bindings?

Barry

Received on 2020-06-09 10:18:17