C++ Logo

sg10

Advanced search

Re: [SG10] Comments from Alisdair

From: Nelson, Clark <clark.nelson_at_[hidden]>
Date: Fri, 23 May 2014 00:53:38 +0000
> The __cpp_lib_has_$foo macros seem to be using a different naming convention from our previous macros, where we had just __cpp_lib_$foo. Is this a deliberate change of direction?

Good question. Is it a change of direction? Possibly. Is it deliberate? Not
yet. :-)

I put in the "has" because, when I first found myself typing
"__cpp_lib_is_final", I had an emotional reaction: the implied question
seemed to be "Is this library final"? :-(

Then I thought, all these changes just add a single name; maybe it would
make sense if all of them use "has" before that name. That was the extent of
my own deliberation, until your message.

But is it a change of direction? Let's consider just the first few macros
we have for the library.

In "__cpp_lib_integer_sequence", "integer_sequence" is a name that was
introduced by the change. But that's not the only name introduced by the
paper; there are also "index_sequence", "make_index_sequence" and
"make_integer_sequence", at least.

On the other hand, the change corresponding to "__cpp_lib_exchange_function"
introduced just a single name: "exchange". Again, there's an emotional
reaction to just "__cpp_lib_exchange".

Then there's "__cpp_lib_tuple_element_t", where "tuple_element_t" is the
only name introduced by the change.

I submit that (A) what we have is already not a model of consistency, and
(B) it might be worth having a special convention for a new feature that
introduces only one name -- and, for example, for tuple_element_t, it's not
too late.

Clark

Received on 2014-05-23 03:05:41