[libcxx-commits] [libcxx] cc2d061 - [libc++][spaceship][NFC] Improved consistency - removed `inline` specifier for `operator<=>`

Hristo Hristov via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 25 00:20:24 PDT 2023


Author: Hristo Hristov
Date: 2023-05-25T10:20:18+03:00
New Revision: cc2d06126653bb7c996685c17c19cb2fdefff2cd

URL: https://github.com/llvm/llvm-project/commit/cc2d06126653bb7c996685c17c19cb2fdefff2cd
DIFF: https://github.com/llvm/llvm-project/commit/cc2d06126653bb7c996685c17c19cb2fdefff2cd.diff

LOG: [libc++][spaceship][NFC] Improved consistency - removed `inline` specifier for `operator<=>`

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

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D151248

Added: 
    

Modified: 
    libcxx/include/deque
    libcxx/include/forward_list
    libcxx/include/list
    libcxx/include/map

Removed: 
    


################################################################################
diff  --git a/libcxx/include/deque b/libcxx/include/deque
index c7d3cdaa5b48..210642464e50 100644
--- a/libcxx/include/deque
+++ b/libcxx/include/deque
@@ -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>);
 }

diff  --git a/libcxx/include/forward_list b/libcxx/include/forward_list
index 19a56acdca0e..5625a0b9b0d5 100644
--- a/libcxx/include/forward_list
+++ b/libcxx/include/forward_list
@@ -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>);
 }

diff  --git a/libcxx/include/list b/libcxx/include/list
index 0d87906871e8..dd56b893cf78 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -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>);
 }

diff  --git a/libcxx/include/map b/libcxx/include/map
index 98c5aca2be3e..eb7c204ac3b2 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -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(),
@@ -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(),


        


More information about the libcxx-commits mailing list