Changeset View
Changeset View
Standalone View
Standalone View
libcxx/include/list
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | ||||||||||
template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> | template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> | |||||||||
list(InputIterator, InputIterator, Allocator = Allocator()) | list(InputIterator, InputIterator, Allocator = Allocator()) | |||||||||
-> list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17 | -> list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17 | |||||||||
template <class T, class Alloc> | template <class T, class Alloc> | |||||||||
bool operator==(const list<T,Alloc>& x, const list<T,Alloc>& y); | bool operator==(const list<T,Alloc>& x, const list<T,Alloc>& y); | |||||||||
template <class T, class Alloc> | template <class T, class Alloc> | |||||||||
bool operator< (const list<T,Alloc>& x, const list<T,Alloc>& y); | bool operator< (const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20 | |||||||||
template <class T, class Alloc> | template <class T, class Alloc> | |||||||||
bool operator!=(const list<T,Alloc>& x, const list<T,Alloc>& y); | bool operator!=(const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20 | |||||||||
template <class T, class Alloc> | template <class T, class Alloc> | |||||||||
bool operator> (const list<T,Alloc>& x, const list<T,Alloc>& y); | bool operator> (const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20 | |||||||||
template <class T, class Alloc> | template <class T, class Alloc> | |||||||||
bool operator>=(const list<T,Alloc>& x, const list<T,Alloc>& y); | bool operator>=(const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20 | |||||||||
template <class T, class Alloc> | template <class T, class Alloc> | |||||||||
bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y); | bool operator<=(const list<T,Alloc>& x, const list<T,Alloc>& y); // removed in C++20 | |||||||||
template<class T, class Allocator> | ||||||||||
synth-three-way-result<T> operator<=>(const list<T, Allocator>& x, | ||||||||||
const list<T, Allocator>& y); // since C++20 | ||||||||||
template <class T, class Alloc> | template <class T, class Alloc> | |||||||||
void swap(list<T,Alloc>& x, list<T,Alloc>& y) | void swap(list<T,Alloc>& x, list<T,Alloc>& y) | |||||||||
noexcept(noexcept(x.swap(y))); | noexcept(noexcept(x.swap(y))); | |||||||||
template <class T, class Allocator, class U> | template <class T, class Allocator, class U> | |||||||||
typename list<T, Allocator>::size_type | typename list<T, Allocator>::size_type | |||||||||
erase(list<T, Allocator>& c, const U& value); // C++20 | erase(list<T, Allocator>& c, const U& value); // since C++20 | |||||||||
template <class T, class Allocator, class Predicate> | template <class T, class Allocator, class Predicate> | |||||||||
typename list<T, Allocator>::size_type | typename list<T, Allocator>::size_type | |||||||||
erase_if(list<T, Allocator>& c, Predicate pred); // C++20 | erase_if(list<T, Allocator>& c, Predicate pred); // since C++20 | |||||||||
} // std | } // std | |||||||||
*/ | */ | |||||||||
#include <__algorithm/comp.h> | #include <__algorithm/comp.h> | |||||||||
#include <__algorithm/equal.h> | #include <__algorithm/equal.h> | |||||||||
#include <__algorithm/lexicographical_compare.h> | #include <__algorithm/lexicographical_compare.h> | |||||||||
#include <__algorithm/lexicographical_compare_three_way.h> | ||||||||||
#include <__algorithm/min.h> | #include <__algorithm/min.h> | |||||||||
#include <__assert> // all public C++ headers provide the assertion handler | #include <__assert> // all public C++ headers provide the assertion handler | |||||||||
#include <__config> | #include <__config> | |||||||||
#include <__debug> | #include <__debug> | |||||||||
#include <__format/enable_insertable.h> | #include <__format/enable_insertable.h> | |||||||||
#include <__iterator/distance.h> | #include <__iterator/distance.h> | |||||||||
#include <__iterator/iterator_traits.h> | #include <__iterator/iterator_traits.h> | |||||||||
#include <__iterator/move_iterator.h> | #include <__iterator/move_iterator.h> | |||||||||
▲ Show 20 Lines • Show All 2,090 Lines • ▼ Show 20 Lines | ||||||||||
template <class _Tp, class _Alloc> | template <class _Tp, class _Alloc> | |||||||||
inline _LIBCPP_INLINE_VISIBILITY | inline _LIBCPP_INLINE_VISIBILITY | |||||||||
bool | bool | |||||||||
operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) | operator==(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) | |||||||||
{ | { | |||||||||
return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin()); | return __x.size() == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin()); | |||||||||
} | } | |||||||||
#if _LIBCPP_STD_VER <= 17 | ||||||||||
template <class _Tp, class _Alloc> | template <class _Tp, class _Alloc> | |||||||||
inline _LIBCPP_INLINE_VISIBILITY | inline _LIBCPP_INLINE_VISIBILITY | |||||||||
bool | bool | |||||||||
operator< (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) | operator< (const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) | |||||||||
{ | { | |||||||||
return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); | return _VSTD::lexicographical_compare(__x.begin(), __x.end(), __y.begin(), __y.end()); | |||||||||
} | } | |||||||||
Show All 24 Lines | ||||||||||
template <class _Tp, class _Alloc> | template <class _Tp, class _Alloc> | |||||||||
inline _LIBCPP_INLINE_VISIBILITY | inline _LIBCPP_INLINE_VISIBILITY | |||||||||
bool | bool | |||||||||
operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) | operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y) | |||||||||
{ | { | |||||||||
return !(__y < __x); | return !(__y < __x); | |||||||||
} | } | |||||||||
#else // _LIBCPP_STD_VER <= 17 | ||||||||||
template<class _Tp, class _Allocator> | ||||||||||
inline _LIBCPP_HIDE_FROM_ABI | ||||||||||
huixie90: `_LIBCPP_HIDE_FROM_ABI` | ||||||||||
perhaps I missed something but have you included the header that defines __synth_three_way_result huixie90: perhaps I missed something but have you included the header that defines… | ||||||||||
the complete <compare> header is a standard-mandated include. See line 226 avogelsgesang: the complete `<compare>` header is a standard-mandated include. See line 226 | ||||||||||
__synth_three_way_result<_Tp> | ||||||||||
operator<=>(const list<_Tp, _Allocator>& __x, const list<_Tp, _Allocator>& __y) | ||||||||||
{ | ||||||||||
return lexicographical_compare_three_way( | ||||||||||
This should fix your CI issue with clang-tidy. ldionne: This should fix your CI issue with clang-tidy. | ||||||||||
yes, I think so, too. Happy we have the ADL test cases nowadays! avogelsgesang: yes, I think so, too. Happy we have the ADL test cases nowadays! | ||||||||||
__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way); | ||||||||||
} | ||||||||||
#endif // _LIBCPP_STD_VER <= 17 | ||||||||||
template <class _Tp, class _Alloc> | template <class _Tp, class _Alloc> | |||||||||
inline _LIBCPP_INLINE_VISIBILITY | inline _LIBCPP_INLINE_VISIBILITY | |||||||||
void | void | |||||||||
swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y) | swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y) | |||||||||
_NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) | _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) | |||||||||
{ | { | |||||||||
__x.swap(__y); | __x.swap(__y); | |||||||||
} | } | |||||||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |
_LIBCPP_HIDE_FROM_ABI