C++ Logo

sg10

Advanced search

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

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Tue, 9 Jun 2020 18:00:42 +0300
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.

Received on 2020-06-09 10:04:03