C++ Logo


Advanced search

Re: [SG10] Updated SD-6 draft

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Wed, 3 Aug 2016 18:46:41 +0100
On 3 August 2016 at 18:33, Jonathan Wakely wrote:
> I've also noticed that for my paper P0074R0, the existing macro __cpp_lib_transparent_operators was changed, rather than adding a new one.The P0074R0 changes only affect <memory> (specifically, the shared_ptr helper type owner_less), and all the original transparent operator changes only affect <functional>, so we might want to say that it's defined by <memory> as well. I'm ambivalent about that though. It's probably OK to leave it as only <functional>.

Hmm, now that I'm implementing it ... I wonder if they should even be
separate macros.

Our less<void> and other transparent operators are only enabled for
C++14 and later.

I'm tempted to enable the owner_less<void> specialization
unconditionally, so it's available for C++11 and later, because it
fixes what what I consider a design defect in std::owner_less. If I
define owner_less<void> for C++11 I can't define the feature-test
macro to say I've done it, because that would imply we also define
std::less<void> etc. for C++11.

Now, you could argue that I should be consistent, and make them both
available for C++11, or neither. But one of the things I like about
feature-test macros is I can "backport" features to previous standards
and use the macro to tell users they are available.

Received on 2016-08-03 19:47:03