diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2017-08-28 23:16:13 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2017-08-28 23:16:13 +0000 |
commit | a763b36ff4f3179a3b3d18bf446f075df5188c68 (patch) | |
tree | 81e983a70cce94b53b31e0eb6102c9910511d51d /libcxx/include/algorithm | |
parent | 4cae10856132f3f038f4f7361c847214e2149f42 (diff) | |
download | bcm5719-llvm-a763b36ff4f3179a3b3d18bf446f075df5188c68.tar.gz bcm5719-llvm-a763b36ff4f3179a3b3d18bf446f075df5188c68.zip |
Fix PR31166: std::inplace_merge seems to be unstable. Thanks to Jan Wilken Dörrie for the suggested fix.
llvm-svn: 311952
Diffstat (limited to 'libcxx/include/algorithm')
-rw-r--r-- | libcxx/include/algorithm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm index 4542275adfd..31df79f1eb5 100644 --- a/libcxx/include/algorithm +++ b/libcxx/include/algorithm @@ -734,15 +734,15 @@ struct __less<_T1, const _T1> }; template <class _Predicate> -class __negate +class __invert // invert the sense of a comparison { private: _Predicate __p_; public: - _LIBCPP_INLINE_VISIBILITY __negate() {} + _LIBCPP_INLINE_VISIBILITY __invert() {} _LIBCPP_INLINE_VISIBILITY - explicit __negate(_Predicate __p) : __p_(__p) {} + explicit __invert(_Predicate __p) : __p_(__p) {} template <class _T1> _LIBCPP_INLINE_VISIBILITY @@ -750,7 +750,7 @@ public: template <class _T1, class _T2> _LIBCPP_INLINE_VISIBILITY - bool operator()(const _T1& __x, const _T2& __y) {return !__p_(__x, __y);} + bool operator()(const _T1& __x, const _T2& __y) {return __p_(__y, __x);} }; #ifdef _LIBCPP_DEBUG @@ -4567,7 +4567,7 @@ __buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator typedef reverse_iterator<value_type*> _Rv; __half_inplace_merge(_Rv(__p), _Rv(__buff), _RBi(__middle), _RBi(__first), - _RBi(__last), __negate<_Compare>(__comp)); + _RBi(__last), __invert<_Compare>(__comp)); } } |