Skip to content

Commit

Permalink
[libc++][spaceship][NFC] Improved consistency - removed inline spec…
Browse files Browse the repository at this point in the history
…ifier for `operator<=>`

Removed `inline` specifier for consistency as discussed in D148416 previously.

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D151248
  • Loading branch information
Zingam committed May 25, 2023
1 parent 246626a commit cc2d061
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 27 deletions.
8 changes: 3 additions & 5 deletions libcxx/include/deque
Expand Up @@ -2920,11 +2920,9 @@ operator<=(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)

#else // _LIBCPP_STD_VER <= 17

template<class _Tp, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
__synth_three_way_result<_Tp>
operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y)
{
template <class _Tp, class _Allocator>
_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
operator<=>(const deque<_Tp, _Allocator>& __x, const deque<_Tp, _Allocator>& __y) {
return std::lexicographical_compare_three_way(
__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
}
Expand Down
9 changes: 3 additions & 6 deletions libcxx/include/forward_list
Expand Up @@ -1774,12 +1774,9 @@ bool operator<=(const forward_list<_Tp, _Alloc>& __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)
{
template <class _Tp, class _Allocator>
_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(), std::__synth_three_way<_Tp, _Tp>);
}
Expand Down
8 changes: 3 additions & 5 deletions libcxx/include/list
Expand Up @@ -2345,11 +2345,9 @@ operator<=(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)

#else // _LIBCPP_STD_VER <= 17

template<class _Tp, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
__synth_three_way_result<_Tp>
operator<=>(const list<_Tp, _Allocator>& __x, const list<_Tp, _Allocator>& __y)
{
template <class _Tp, class _Allocator>
_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<_Tp>
operator<=>(const list<_Tp, _Allocator>& __x, const list<_Tp, _Allocator>& __y) {
return std::lexicographical_compare_three_way(
__x.begin(), __x.end(), __y.begin(), __y.end(), std::__synth_three_way<_Tp, _Tp>);
}
Expand Down
17 changes: 6 additions & 11 deletions libcxx/include/map
Expand Up @@ -1737,12 +1737,9 @@ operator<=(const map<_Key, _Tp, _Compare, _Allocator>& __x,

#else // #if _LIBCPP_STD_VER <= 17

template<class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
__synth_three_way_result<pair<const _Key, _Tp>>
operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x,
const map<_Key, _Tp, _Compare, _Allocator>& __y)
{
template <class _Key, class _Tp, class _Compare, class _Allocator>
_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>
operator<=>(const map<_Key, _Tp, _Compare, _Allocator>& __x, const map<_Key, _Tp, _Compare, _Allocator>& __y) {
return std::lexicographical_compare_three_way(
__x.begin(),
__x.end(),
Expand Down Expand Up @@ -2351,12 +2348,10 @@ operator<=(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,

#else // #if _LIBCPP_STD_VER <= 17

template<class _Key, class _Tp, class _Compare, class _Allocator>
inline _LIBCPP_HIDE_FROM_ABI
__synth_three_way_result<pair<const _Key, _Tp>>
template <class _Key, class _Tp, class _Compare, class _Allocator>
_LIBCPP_HIDE_FROM_ABI __synth_three_way_result<pair<const _Key, _Tp>>
operator<=>(const multimap<_Key, _Tp, _Compare, _Allocator>& __x,
const multimap<_Key, _Tp, _Compare, _Allocator>& __y)
{
const multimap<_Key, _Tp, _Compare, _Allocator>& __y) {
return std::lexicographical_compare_three_way(
__x.begin(),
__x.end(),
Expand Down

0 comments on commit cc2d061

Please sign in to comment.