C++ Logo

sg10

Advanced search

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

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Mon, 15 Jun 2020 14:48:41 +0000
These protracted debate over feature test macros always remind me of the sage words of the inventor of macros for C, Doug McIlroy (and the inventor of the field of Software Engineering):


Ø Most #ifdef's and #if's memorialize failures of imagination

Ø or care, often in the name of "portability". Code is

Ø NOT portable if it has to be rewritten according to the

Ø conventions of each environment. Ifdef expresses just such

Ø rewriting, and in an egregious style: it inverts the

Ø logical structure of a program, bringing the tweaks to

Ø the top while fragmenting the real architecture.

Source: https://www.mail-archive.com/hugs-users_at_[hidden].org/msg00795.html

-- Gaby

From: Core <core-bounces_at_[hidden]> On Behalf Of Barry Revzin via Core
Sent: Monday, June 15, 2020 7:27 AM
To: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Cc: Barry Revzin <barry.revzin_at_[hidden]>; Marek Polacek <polacek_at_[hidden]>; C++ Core Language Working Group <core_at_[hidden]>; sg10_at_[hidden]
Subject: Re: [isocpp-core] [SG10] Feature-test macro for ADL calls with template arguments?



On Tue, Jun 9, 2020 at 10:18 AM Ville Voutilainen <ville.voutilainen_at_[hidden]<mailto:ville.voutilainen_at_[hidden]>> wrote:
On Tue, 9 Jun 2020 at 18:15, Barry Revzin <barry.revzin_at_[hidden]<mailto:barry.revzin_at_[hidden]>> wrote:
>> 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?

The claim is that it's plausible to not provide a get<> if it can't be
ADL-called without additional incantations.
Choosing to do so will also not-enable support for structured bindings.

That seems like a surprising choice to me... but conditionally providing functionality is basically what we have feature test macros for, so I guess it makes sense.

Barry

Received on 2020-06-15 09:51:51