Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/include/forward_list
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | template <class InputIterator, class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> | ||||
-> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17 | -> forward_list<typename iterator_traits<InputIterator>::value_type, Allocator>; // C++17 | ||||
template <class T, class Allocator> | template <class T, class Allocator> | ||||
bool operator==(const forward_list<T, Allocator>& x, | bool operator==(const forward_list<T, Allocator>& x, | ||||
const forward_list<T, Allocator>& y); | const forward_list<T, Allocator>& y); | ||||
template <class T, class Allocator> | template <class T, class Allocator> | ||||
bool operator< (const forward_list<T, Allocator>& x, | bool operator< (const forward_list<T, Allocator>& x, | ||||
const forward_list<T, Allocator>& y); | const forward_list<T, Allocator>& y); // removed in C++20 | ||||
template <class T, class Allocator> | template <class T, class Allocator> | ||||
bool operator!=(const forward_list<T, Allocator>& x, | bool operator!=(const forward_list<T, Allocator>& x, | ||||
const forward_list<T, Allocator>& y); | const forward_list<T, Allocator>& y); // removed in C++20 | ||||
template <class T, class Allocator> | template <class T, class Allocator> | ||||
bool operator> (const forward_list<T, Allocator>& x, | bool operator> (const forward_list<T, Allocator>& x, | ||||
const forward_list<T, Allocator>& y); | const forward_list<T, Allocator>& y); // removed in C++20 | ||||
template <class T, class Allocator> | template <class T, class Allocator> | ||||
bool operator>=(const forward_list<T, Allocator>& x, | bool operator>=(const forward_list<T, Allocator>& x, | ||||
const forward_list<T, Allocator>& y); | const forward_list<T, Allocator>& y); // removed in C++20 | ||||
template <class T, class Allocator> | template <class T, class Allocator> | ||||
bool operator<=(const forward_list<T, Allocator>& x, | bool operator<=(const forward_list<T, Allocator>& x, | ||||
const forward_list<T, Allocator>& y); | const forward_list<T, Allocator>& y); // removed in C++20 | ||||
template<class T, class Allocator> | |||||
synth-three-way-result<T> operator<=>(const forward_list<T, Allocator>& x, | |||||
const forward_list<T, Allocator>& y); // since C++20 | |||||
template <class T, class Allocator> | template <class T, class Allocator> | ||||
void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& y) | void swap(forward_list<T, Allocator>& x, forward_list<T, Allocator>& 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 forward_list<T, Allocator>::size_type | typename forward_list<T, Allocator>::size_type | ||||
erase(forward_list<T, Allocator>& c, const U& value); // C++20 | erase(forward_list<T, Allocator>& c, const U& value); // C++20 | ||||
template <class T, class Allocator, class Predicate> | template <class T, class Allocator, class Predicate> | ||||
typename forward_list<T, Allocator>::size_type | typename forward_list<T, Allocator>::size_type | ||||
erase_if(forward_list<T, Allocator>& c, Predicate pred); // C++20 | erase_if(forward_list<T, Allocator>& c, Predicate pred); // C++20 | ||||
} // std | } // std | ||||
*/ | */ | ||||
#include <__algorithm/comp.h> | #include <__algorithm/comp.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 <__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> | ||||
#include <__iterator/next.h> | #include <__iterator/next.h> | ||||
#include <__memory/addressof.h> | #include <__memory/addressof.h> | ||||
▲ Show 20 Lines • Show All 1,514 Lines • ▼ Show 20 Lines | bool operator==(const forward_list<_Tp, _Alloc>& __x, | ||||
_Ip __iy = __y.begin(); | _Ip __iy = __y.begin(); | ||||
_Ip __ey = __y.end(); | _Ip __ey = __y.end(); | ||||
for (; __ix != __ex && __iy != __ey; ++__ix, ++__iy) | for (; __ix != __ex && __iy != __ey; ++__ix, ++__iy) | ||||
if (!(*__ix == *__iy)) | if (!(*__ix == *__iy)) | ||||
return false; | return false; | ||||
return (__ix == __ex) == (__iy == __ey); | return (__ix == __ex) == (__iy == __ey); | ||||
} | } | ||||
#if _LIBCPP_STD_VER <= 17 | |||||
template <class _Tp, class _Alloc> | template <class _Tp, class _Alloc> | ||||
inline _LIBCPP_INLINE_VISIBILITY | inline _LIBCPP_INLINE_VISIBILITY | ||||
bool operator!=(const forward_list<_Tp, _Alloc>& __x, | bool operator!=(const forward_list<_Tp, _Alloc>& __x, | ||||
const forward_list<_Tp, _Alloc>& __y) | const forward_list<_Tp, _Alloc>& __y) | ||||
{ | { | ||||
return !(__x == __y); | return !(__x == __y); | ||||
} | } | ||||
Show All 25 Lines | |||||
template <class _Tp, class _Alloc> | template <class _Tp, class _Alloc> | ||||
inline _LIBCPP_INLINE_VISIBILITY | inline _LIBCPP_INLINE_VISIBILITY | ||||
bool operator<=(const forward_list<_Tp, _Alloc>& __x, | bool operator<=(const forward_list<_Tp, _Alloc>& __x, | ||||
const forward_list<_Tp, _Alloc>& __y) | const forward_list<_Tp, _Alloc>& __y) | ||||
{ | { | ||||
return !(__y < __x); | return !(__y < __x); | ||||
} | } | ||||
#else // #if _LIBCPP_STD_VER <= 17 | |||||
template<class _Tp, class _Allocator> | |||||
inline _LIBCPP_HIDE_FROM_ABI | |||||
__synth_three_way_result<_Tp> | |||||
operator<=>(const forward_list<_Tp, _Allocator>& __x, | |||||
const forward_list<_Tp, _Allocator>& __y) | |||||
{ | |||||
return std::lexicographical_compare_three_way( | |||||
__x.begin(), __x.end(), __y.begin(), __y.end(), __synth_three_way); | |||||
} | |||||
#endif // #if _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(forward_list<_Tp, _Alloc>& __x, forward_list<_Tp, _Alloc>& __y) | swap(forward_list<_Tp, _Alloc>& __x, forward_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 41 Lines • Show Last 20 Lines |