Implements part of P1614R2 "The Mothership has Landed"
ldionne philnik Mordante mumbleskates
- Group Reviewers
- rG0e876eda260a: [libc++] Implement `operator<=>` for `error_category`
nit, per most-common pattern and personal preference
nit: Most checks of _LIBCPP_STD_VER are in terms of >, such that these blocks would be reversed, with C++20-onwards behavior gated behind _LIBCPP_STD_VER > 17. For consistency's sake I think it would be good to match that.
I usually prefer it this way around, because I value "keeping the order between synopsis and implementation consistent" over "consistently use _LIBCPP_STD_VER > 17".
Do you think swapping the #if here is worth it, although that would mean that the order in the synopsis no longer matches the order in the implementation?
okay, i can see that rationale. in my previous differentials (<=> for pair and tuple) i implemented it in the order you've seen me do, preferring a > 17 check and putting modern operators (==, <=>) first and outdated ones in the #else branch in cases where <=> obsoletes the other operators.
understanding your rationale i have a weaker preference now, still leaning towards whatever our conventional momentum is.
LGTM modulo some nits.
I have a preference, but we don't a required style. Traditionally the > xx was more common.
This requires including __memory/addressof.h. This guards against overloading operator&, not a real issue here but in other places, like containers it is.
I didn't mention it since code reviews shouldn't be about getting the code in the exact preferred style of the reviewer. Since we already use different styles there's no "project style".
But you guessed right and I personally prefer > XX, but a portion of that is just because I'm used to it.