Our implementation of swappable_with speculatively implemented the proposed resolution for LWG-3175 (a Library Issue, which is a bug report against the C++ Standard):
|
template <class _Ty1, class _Ty2>
|
|
concept swappable_with =
|
|
#if 1 // Implement the PR of LWG-3175
|
|
common_reference_with<_Ty1, _Ty2>
|
|
#else // ^^^ LWG-3175 / N4810 vvv
|
|
common_reference_with<const remove_reference_t<_Ty1>&, const remove_reference_t<_Ty2>&>
|
|
#endif // select LWG-3175 vs. N4810
|
|
&& requires(_Ty1&& __t, _Ty2&& __u) {
|
|
_RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty1&&>(__t));
|
|
_RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty2&&>(__u));
|
|
_RANGES swap(static_cast<_Ty1&&>(__t), static_cast<_Ty2&&>(__u));
|
|
_RANGES swap(static_cast<_Ty2&&>(__u), static_cast<_Ty1&&>(__t));
|
|
};
|
At the February 2020 meeting in Prague, LWG-3175 was resolved for C++20. Therefore, we should keep line 186 here, but remove lines 185 and 187-189.
Our implementation of
swappable_withspeculatively implemented the proposed resolution for LWG-3175 (a Library Issue, which is a bug report against the C++ Standard):STL/stl/inc/concepts
Lines 183 to 195 in e034296
At the February 2020 meeting in Prague, LWG-3175 was resolved for C++20. Therefore, we should keep line 186 here, but remove lines 185 and 187-189.