C++ Logo

SG10

Advanced search

Subject: Re: [isocpp-core] Feature-test macro for ADL calls with template arguments?
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2020-06-09 10:00:42


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.


SG10 list run by sg10-owner@lists.isocpp.org