This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3 PATCH] LWG 2766, LWG 2749
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 22 Nov 2016 13:36:46 +0000
- Subject: Re: [v3 PATCH] LWG 2766, LWG 2749
- Authentication-results: sourceware.org; auth=none
- References: <CAFk2RUbErzFd3mGZUiBDf1=X3ruEG03_1EvD4CWHFw-y4ctXWQ@mail.gmail.com>
On 17/11/16 23:38 +0200, Ville Voutilainen wrote:
@@ -478,6 +478,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
noexcept(noexcept(__x.swap(__y)))
{ __x.swap(__y); }
+
+#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
+ template<typename _T1, typename _T2>
+ inline
+ typename enable_if<__not_<__and_<__is_swappable<_T1>,
+ __is_swappable<_T2>>>::value>::type
+ swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
Is there any advantage to using __not_ here, rather than just:
typename enable_if<!__and_<__is_swappable<_T1>,
__is_swappable<_T2>>::value>::type
?
__not_ is useful as a sub-expression of an __and_ / __or_ expression,
but at the top level doesn't seem to buy anything, and is more typing,
and requires indenting the code further.