[libcxx-commits] [libcxx] 5ed162c - [libc++][NFC] Replace uses of 'constexpr friend' by 'friend constexpr'

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 16 08:43:09 PDT 2021


Author: Louis Dionne
Date: 2021-08-16T11:43:05-04:00
New Revision: 5ed162c8f9a430564820dd393f7ca8a666a739e2

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

LOG: [libc++][NFC] Replace uses of 'constexpr friend' by 'friend constexpr'

This is done for consistency, since that's what we do everywhere else
in the library.

Added: 
    

Modified: 
    libcxx/test/std/ranges/range.adaptors/range.take/types.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/ranges/range.adaptors/range.take/types.h b/libcxx/test/std/ranges/range.adaptors/range.take/types.h
index e260de2e38cf3..72563eecfc925 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.take/types.h
+++ b/libcxx/test/std/ranges/range.adaptors/range.take/types.h
@@ -34,12 +34,12 @@ using ForwardIter = forward_iterator<int*>;
 struct SizedForwardView : std::ranges::view_base {
   int *ptr_;
   constexpr SizedForwardView(int* ptr) : ptr_(ptr) {}
-  constexpr friend ForwardIter begin(SizedForwardView& view) { return ForwardIter(view.ptr_); }
-  constexpr friend ForwardIter begin(SizedForwardView const& view) { return ForwardIter(view.ptr_); }
-  constexpr friend sentinel_wrapper<ForwardIter> end(SizedForwardView& view) {
+  friend constexpr ForwardIter begin(SizedForwardView& view) { return ForwardIter(view.ptr_); }
+  friend constexpr ForwardIter begin(SizedForwardView const& view) { return ForwardIter(view.ptr_); }
+  friend constexpr sentinel_wrapper<ForwardIter> end(SizedForwardView& view) {
     return sentinel_wrapper<ForwardIter>{ForwardIter(view.ptr_ + 8)};
   }
-  constexpr friend sentinel_wrapper<ForwardIter> end(SizedForwardView const& view) {
+  friend constexpr sentinel_wrapper<ForwardIter> end(SizedForwardView const& view) {
     return sentinel_wrapper<ForwardIter>{ForwardIter(view.ptr_ + 8)};
   }
 };
@@ -55,12 +55,12 @@ using RandomAccessIter = random_access_iterator<int*>;
 struct SizedRandomAccessView : std::ranges::view_base {
   int *ptr_;
   constexpr SizedRandomAccessView(int* ptr) : ptr_(ptr) {}
-  constexpr friend RandomAccessIter begin(SizedRandomAccessView& view) { return RandomAccessIter(view.ptr_); }
-  constexpr friend RandomAccessIter begin(SizedRandomAccessView const& view) { return RandomAccessIter(view.ptr_); }
-  constexpr friend sentinel_wrapper<RandomAccessIter> end(SizedRandomAccessView& view) {
+  friend constexpr RandomAccessIter begin(SizedRandomAccessView& view) { return RandomAccessIter(view.ptr_); }
+  friend constexpr RandomAccessIter begin(SizedRandomAccessView const& view) { return RandomAccessIter(view.ptr_); }
+  friend constexpr sentinel_wrapper<RandomAccessIter> end(SizedRandomAccessView& view) {
     return sentinel_wrapper<RandomAccessIter>{RandomAccessIter(view.ptr_ + 8)};
   }
-  constexpr friend sentinel_wrapper<RandomAccessIter> end(SizedRandomAccessView const& view) {
+  friend constexpr sentinel_wrapper<RandomAccessIter> end(SizedRandomAccessView const& view) {
     return sentinel_wrapper<RandomAccessIter>{RandomAccessIter(view.ptr_ + 8)};
   }
 };


        


More information about the libcxx-commits mailing list