[libcxx][nfc] Global `constexpr friend` -> `friend constexpr`.

This commit is contained in:
zoecarver 2021-07-23 09:08:18 -07:00
parent e5d8b93e5a
commit 1e4ba7eba6
14 changed files with 103 additions and 103 deletions

View File

@ -31,12 +31,12 @@ public:
return false;
}
constexpr friend std::ptrdiff_t operator-(std::input_or_output_iterator auto const&,
friend constexpr std::ptrdiff_t operator-(std::input_or_output_iterator auto const&,
distance_apriori_sentinel const y) {
return -y.count_;
}
constexpr friend std::ptrdiff_t operator-(distance_apriori_sentinel const x,
friend constexpr std::ptrdiff_t operator-(distance_apriori_sentinel const x,
std::input_or_output_iterator auto const&) {
return x.count_;
}

View File

@ -31,12 +31,12 @@ public:
return false;
}
constexpr friend std::ptrdiff_t operator-(std::input_or_output_iterator auto const&,
friend constexpr std::ptrdiff_t operator-(std::input_or_output_iterator auto const&,
distance_apriori_sentinel const y) {
return -y.count_;
}
constexpr friend std::ptrdiff_t operator-(distance_apriori_sentinel const x,
friend constexpr std::ptrdiff_t operator-(distance_apriori_sentinel const x,
std::input_or_output_iterator auto const&) {
return x.count_;
}

View File

@ -32,12 +32,12 @@ public:
return false;
}
constexpr friend std::ptrdiff_t operator-(std::input_or_output_iterator auto const&,
friend constexpr std::ptrdiff_t operator-(std::input_or_output_iterator auto const&,
distance_apriori_sentinel const y) {
return -y.count_;
}
constexpr friend std::ptrdiff_t operator-(distance_apriori_sentinel const x,
friend constexpr std::ptrdiff_t operator-(distance_apriori_sentinel const x,
std::input_or_output_iterator auto const&) {
return x.count_;
}

View File

@ -123,7 +123,7 @@ static_assert(!std::is_invocable_v<RangeDataT, BeginMemberRandomAccess const&>);
struct BeginFriendContiguousIterator {
int buff[8];
constexpr friend ContiguousIter begin(const BeginFriendContiguousIterator &iter) {
friend constexpr ContiguousIter begin(const BeginFriendContiguousIterator &iter) {
return ContiguousIter(iter.buff);
}
};

View File

@ -27,10 +27,10 @@ struct View : std::ranges::view_base {
constexpr explicit View(int start) : start_(start) {}
View(View&&) noexcept(IsNoexcept) = default;
View& operator=(View&&) noexcept(IsNoexcept) = default;
constexpr friend int* begin(View& view) { return globalBuff + view.start_; }
constexpr friend int* begin(View const& view) { return globalBuff + view.start_; }
constexpr friend int* end(View&) { return globalBuff + 8; }
constexpr friend int* end(View const&) { return globalBuff + 8; }
friend constexpr int* begin(View& view) { return globalBuff + view.start_; }
friend constexpr int* begin(View const& view) { return globalBuff + view.start_; }
friend constexpr int* end(View&) { return globalBuff + 8; }
friend constexpr int* end(View const&) { return globalBuff + 8; }
};
static_assert(std::ranges::view<View<true>>);
static_assert(std::ranges::view<View<false>>);
@ -42,10 +42,10 @@ struct CopyableView : std::ranges::view_base {
CopyableView(CopyableView const&) noexcept(IsNoexcept) = default;
CopyableView& operator=(CopyableView const&) noexcept(IsNoexcept) = default;
constexpr explicit CopyableView(int start) noexcept : start_(start) {}
constexpr friend int* begin(CopyableView& view) { return globalBuff + view.start_; }
constexpr friend int* begin(CopyableView const& view) { return globalBuff + view.start_; }
constexpr friend int* end(CopyableView&) { return globalBuff + 8; }
constexpr friend int* end(CopyableView const&) { return globalBuff + 8; }
friend constexpr int* begin(CopyableView& view) { return globalBuff + view.start_; }
friend constexpr int* begin(CopyableView const& view) { return globalBuff + view.start_; }
friend constexpr int* end(CopyableView&) { return globalBuff + 8; }
friend constexpr int* end(CopyableView const&) { return globalBuff + 8; }
};
static_assert(std::ranges::view<CopyableView<true>>);
static_assert(std::ranges::view<CopyableView<false>>);
@ -53,19 +53,19 @@ static_assert(std::ranges::view<CopyableView<false>>);
struct Range {
int start_;
constexpr explicit Range(int start) noexcept : start_(start) {}
constexpr friend int* begin(Range const& range) { return globalBuff + range.start_; }
constexpr friend int* begin(Range& range) { return globalBuff + range.start_; }
constexpr friend int* end(Range const&) { return globalBuff + 8; }
constexpr friend int* end(Range&) { return globalBuff + 8; }
friend constexpr int* begin(Range const& range) { return globalBuff + range.start_; }
friend constexpr int* begin(Range& range) { return globalBuff + range.start_; }
friend constexpr int* end(Range const&) { return globalBuff + 8; }
friend constexpr int* end(Range&) { return globalBuff + 8; }
};
struct BorrowableRange {
int start_;
constexpr explicit BorrowableRange(int start) noexcept : start_(start) {}
constexpr friend int* begin(BorrowableRange const& range) { return globalBuff + range.start_; }
constexpr friend int* begin(BorrowableRange& range) { return globalBuff + range.start_; }
constexpr friend int* end(BorrowableRange const&) { return globalBuff + 8; }
constexpr friend int* end(BorrowableRange&) { return globalBuff + 8; }
friend constexpr int* begin(BorrowableRange const& range) { return globalBuff + range.start_; }
friend constexpr int* begin(BorrowableRange& range) { return globalBuff + range.start_; }
friend constexpr int* end(BorrowableRange const&) { return globalBuff + 8; }
friend constexpr int* end(BorrowableRange&) { return globalBuff + 8; }
};
template<>
inline constexpr bool std::ranges::enable_borrowed_range<BorrowableRange> = true;

View File

@ -25,12 +25,12 @@ struct ContiguousView : std::ranges::view_base {
constexpr ContiguousView(int* ptr) : ptr_(ptr) {}
constexpr ContiguousView(ContiguousView&&) = default;
constexpr ContiguousView& operator=(ContiguousView&&) = default;
constexpr friend int* begin(ContiguousView& view) { return view.ptr_; }
constexpr friend int* begin(ContiguousView const& view) { return view.ptr_; }
constexpr friend sentinel_wrapper<int*> end(ContiguousView& view) {
friend constexpr int* begin(ContiguousView& view) { return view.ptr_; }
friend constexpr int* begin(ContiguousView const& view) { return view.ptr_; }
friend constexpr sentinel_wrapper<int*> end(ContiguousView& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
constexpr friend sentinel_wrapper<int*> end(ContiguousView const& view) {
friend constexpr sentinel_wrapper<int*> end(ContiguousView const& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
};
@ -38,12 +38,12 @@ struct ContiguousView : std::ranges::view_base {
struct CopyableView : std::ranges::view_base {
int *ptr_;
constexpr CopyableView(int* ptr) : ptr_(ptr) {}
constexpr friend int* begin(CopyableView& view) { return view.ptr_; }
constexpr friend int* begin(CopyableView const& view) { return view.ptr_; }
constexpr friend sentinel_wrapper<int*> end(CopyableView& view) {
friend constexpr int* begin(CopyableView& view) { return view.ptr_; }
friend constexpr int* begin(CopyableView const& view) { return view.ptr_; }
friend constexpr sentinel_wrapper<int*> end(CopyableView& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
constexpr friend sentinel_wrapper<int*> end(CopyableView const& view) {
friend constexpr sentinel_wrapper<int*> end(CopyableView const& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
};

View File

@ -25,12 +25,12 @@ struct ContiguousView : std::ranges::view_base {
constexpr ContiguousView(int* ptr) : ptr_(ptr) {}
constexpr ContiguousView(ContiguousView&&) = default;
constexpr ContiguousView& operator=(ContiguousView&&) = default;
constexpr friend int* begin(ContiguousView& view) { return view.ptr_; }
constexpr friend int* begin(ContiguousView const& view) { return view.ptr_; }
constexpr friend sentinel_wrapper<int*> end(ContiguousView& view) {
friend constexpr int* begin(ContiguousView& view) { return view.ptr_; }
friend constexpr int* begin(ContiguousView const& view) { return view.ptr_; }
friend constexpr sentinel_wrapper<int*> end(ContiguousView& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
constexpr friend sentinel_wrapper<int*> end(ContiguousView const& view) {
friend constexpr sentinel_wrapper<int*> end(ContiguousView const& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
};
@ -38,12 +38,12 @@ struct ContiguousView : std::ranges::view_base {
struct CopyableView : std::ranges::view_base {
int *ptr_;
constexpr CopyableView(int* ptr) : ptr_(ptr) {}
constexpr friend int* begin(CopyableView& view) { return view.ptr_; }
constexpr friend int* begin(CopyableView const& view) { return view.ptr_; }
constexpr friend sentinel_wrapper<int*> end(CopyableView& view) {
friend constexpr int* begin(CopyableView& view) { return view.ptr_; }
friend constexpr int* begin(CopyableView const& view) { return view.ptr_; }
friend constexpr sentinel_wrapper<int*> end(CopyableView& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
constexpr friend sentinel_wrapper<int*> end(CopyableView const& view) {
friend constexpr sentinel_wrapper<int*> end(CopyableView const& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
};
@ -59,12 +59,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)};
}
};
@ -80,12 +80,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)};
}
};

View File

@ -25,12 +25,12 @@ struct ContiguousView : std::ranges::view_base {
constexpr ContiguousView(int* ptr) : ptr_(ptr) {}
constexpr ContiguousView(ContiguousView&&) = default;
constexpr ContiguousView& operator=(ContiguousView&&) = default;
constexpr friend int* begin(ContiguousView& view) { return view.ptr_; }
constexpr friend int* begin(ContiguousView const& view) { return view.ptr_; }
constexpr friend sentinel_wrapper<int*> end(ContiguousView& view) {
friend constexpr int* begin(ContiguousView& view) { return view.ptr_; }
friend constexpr int* begin(ContiguousView const& view) { return view.ptr_; }
friend constexpr sentinel_wrapper<int*> end(ContiguousView& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
constexpr friend sentinel_wrapper<int*> end(ContiguousView const& view) {
friend constexpr sentinel_wrapper<int*> end(ContiguousView const& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
};
@ -38,12 +38,12 @@ struct ContiguousView : std::ranges::view_base {
struct CopyableView : std::ranges::view_base {
int *ptr_;
constexpr CopyableView(int* ptr = globalBuffer) : ptr_(ptr) {}
constexpr friend int* begin(CopyableView& view) { return view.ptr_; }
constexpr friend int* begin(CopyableView const& view) { return view.ptr_; }
constexpr friend sentinel_wrapper<int*> end(CopyableView& view) {
friend constexpr int* begin(CopyableView& view) { return view.ptr_; }
friend constexpr int* begin(CopyableView const& view) { return view.ptr_; }
friend constexpr sentinel_wrapper<int*> end(CopyableView& view) {
return sentinel_wrapper<int*>{view.ptr_ + 4};
}
constexpr friend sentinel_wrapper<int*> end(CopyableView const& view) {
friend constexpr sentinel_wrapper<int*> end(CopyableView const& view) {
return sentinel_wrapper<int*>{view.ptr_ + 4};
}
};

View File

@ -22,12 +22,12 @@
struct CopyableView : std::ranges::view_base {
int *ptr_;
constexpr CopyableView(int* ptr) : ptr_(ptr) {}
constexpr friend int* begin(CopyableView& view) { return view.ptr_; }
constexpr friend int* begin(CopyableView const& view) { return view.ptr_; }
constexpr friend sentinel_wrapper<int*> end(CopyableView& view) {
friend constexpr int* begin(CopyableView& view) { return view.ptr_; }
friend constexpr int* begin(CopyableView const& view) { return view.ptr_; }
friend constexpr sentinel_wrapper<int*> end(CopyableView& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
constexpr friend sentinel_wrapper<int*> end(CopyableView const& view) {
friend constexpr sentinel_wrapper<int*> end(CopyableView const& view) {
return sentinel_wrapper<int*>{view.ptr_ + 8};
}
};
@ -36,12 +36,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)};
}
};

View File

@ -19,10 +19,10 @@ struct ContiguousView : std::ranges::view_base {
constexpr ContiguousView(int start = 0) : start_(start) {}
constexpr ContiguousView(ContiguousView&&) = default;
constexpr ContiguousView& operator=(ContiguousView&&) = default;
constexpr friend int* begin(ContiguousView& view) { return globalBuff + view.start_; }
constexpr friend int* begin(ContiguousView const& view) { return globalBuff + view.start_; }
constexpr friend int* end(ContiguousView&) { return globalBuff + 8; }
constexpr friend int* end(ContiguousView const&) { return globalBuff + 8; }
friend constexpr int* begin(ContiguousView& view) { return globalBuff + view.start_; }
friend constexpr int* begin(ContiguousView const& view) { return globalBuff + view.start_; }
friend constexpr int* end(ContiguousView&) { return globalBuff + 8; }
friend constexpr int* end(ContiguousView const&) { return globalBuff + 8; }
};
struct CopyableView : std::ranges::view_base {
@ -30,10 +30,10 @@ struct CopyableView : std::ranges::view_base {
constexpr CopyableView(int start = 0) : start_(start) {}
constexpr CopyableView(CopyableView const&) = default;
constexpr CopyableView& operator=(CopyableView const&) = default;
constexpr friend int* begin(CopyableView& view) { return globalBuff + view.start_; }
constexpr friend int* begin(CopyableView const& view) { return globalBuff + view.start_; }
constexpr friend int* end(CopyableView&) { return globalBuff + 8; }
constexpr friend int* end(CopyableView const&) { return globalBuff + 8; }
friend constexpr int* begin(CopyableView& view) { return globalBuff + view.start_; }
friend constexpr int* begin(CopyableView const& view) { return globalBuff + view.start_; }
friend constexpr int* end(CopyableView&) { return globalBuff + 8; }
friend constexpr int* end(CopyableView const&) { return globalBuff + 8; }
};
using ForwardIter = forward_iterator<int*>;
@ -41,10 +41,10 @@ struct ForwardView : std::ranges::view_base {
constexpr ForwardView() = default;
constexpr ForwardView(ForwardView&&) = default;
constexpr ForwardView& operator=(ForwardView&&) = default;
constexpr friend ForwardIter begin(ForwardView&) { return ForwardIter(globalBuff); }
constexpr friend ForwardIter begin(ForwardView const&) { return ForwardIter(globalBuff); }
constexpr friend ForwardIter end(ForwardView&) { return ForwardIter(globalBuff + 8); }
constexpr friend ForwardIter end(ForwardView const&) { return ForwardIter(globalBuff + 8); }
friend constexpr ForwardIter begin(ForwardView&) { return ForwardIter(globalBuff); }
friend constexpr ForwardIter begin(ForwardView const&) { return ForwardIter(globalBuff); }
friend constexpr ForwardIter end(ForwardView&) { return ForwardIter(globalBuff + 8); }
friend constexpr ForwardIter end(ForwardView const&) { return ForwardIter(globalBuff + 8); }
};
struct ForwardRange {

View File

@ -16,10 +16,10 @@ struct ContiguousView : std::ranges::view_base {
constexpr ContiguousView(int* ptr = globalBuff, int start = 0) : start_(start), ptr_(ptr) {}
constexpr ContiguousView(ContiguousView&&) = default;
constexpr ContiguousView& operator=(ContiguousView&&) = default;
constexpr friend int* begin(ContiguousView& view) { return view.ptr_ + view.start_; }
constexpr friend int* begin(ContiguousView const& view) { return view.ptr_ + view.start_; }
constexpr friend int* end(ContiguousView& view) { return view.ptr_ + 8; }
constexpr friend int* end(ContiguousView const& view) { return view.ptr_ + 8; }
friend constexpr int* begin(ContiguousView& view) { return view.ptr_ + view.start_; }
friend constexpr int* begin(ContiguousView const& view) { return view.ptr_ + view.start_; }
friend constexpr int* end(ContiguousView& view) { return view.ptr_ + 8; }
friend constexpr int* end(ContiguousView const& view) { return view.ptr_ + 8; }
};
struct CopyableView : std::ranges::view_base {
@ -27,10 +27,10 @@ struct CopyableView : std::ranges::view_base {
constexpr CopyableView(int start = 0) : start_(start) {}
constexpr CopyableView(CopyableView const&) = default;
constexpr CopyableView& operator=(CopyableView const&) = default;
constexpr friend int* begin(CopyableView& view) { return globalBuff + view.start_; }
constexpr friend int* begin(CopyableView const& view) { return globalBuff + view.start_; }
constexpr friend int* end(CopyableView&) { return globalBuff + 8; }
constexpr friend int* end(CopyableView const&) { return globalBuff + 8; }
friend constexpr int* begin(CopyableView& view) { return globalBuff + view.start_; }
friend constexpr int* begin(CopyableView const& view) { return globalBuff + view.start_; }
friend constexpr int* end(CopyableView&) { return globalBuff + 8; }
friend constexpr int* end(CopyableView const&) { return globalBuff + 8; }
};
using ForwardIter = forward_iterator<int*>;
@ -39,10 +39,10 @@ struct ForwardView : std::ranges::view_base {
constexpr ForwardView(int* ptr = globalBuff) : ptr_(ptr) {}
constexpr ForwardView(ForwardView&&) = default;
constexpr ForwardView& operator=(ForwardView&&) = default;
constexpr friend ForwardIter begin(ForwardView& view) { return ForwardIter(view.ptr_); }
constexpr friend ForwardIter begin(ForwardView const& view) { return ForwardIter(view.ptr_); }
constexpr friend ForwardIter end(ForwardView& view) { return ForwardIter(view.ptr_ + 8); }
constexpr friend ForwardIter end(ForwardView const& view) { return ForwardIter(view.ptr_ + 8); }
friend constexpr ForwardIter begin(ForwardView& view) { return ForwardIter(view.ptr_); }
friend constexpr ForwardIter begin(ForwardView const& view) { return ForwardIter(view.ptr_); }
friend constexpr ForwardIter end(ForwardView& view) { return ForwardIter(view.ptr_ + 8); }
friend constexpr ForwardIter end(ForwardView const& view) { return ForwardIter(view.ptr_ + 8); }
};
using ForwardRange = test_common_range<forward_iterator>;

View File

@ -31,7 +31,7 @@ public:
constexpr X(int i) : i_(i) {}
constexpr X(int i, int j) : i_(i), j_(j) {}
constexpr friend bool operator==(const X& x, const X& y)
friend constexpr bool operator==(const X& x, const X& y)
{return x.i_ == y.i_ && x.j_ == y.j_;}
};

View File

@ -848,25 +848,25 @@ public:
return *this;
}
constexpr friend stride_counting_iterator operator+(stride_counting_iterator i, difference_type const n)
friend constexpr stride_counting_iterator operator+(stride_counting_iterator i, difference_type const n)
requires std::random_access_iterator<I>
{
return i += n;
}
constexpr friend stride_counting_iterator operator+(difference_type const n, stride_counting_iterator i)
friend constexpr stride_counting_iterator operator+(difference_type const n, stride_counting_iterator i)
requires std::random_access_iterator<I>
{
return i += n;
}
constexpr friend stride_counting_iterator operator-(stride_counting_iterator i, difference_type const n)
friend constexpr stride_counting_iterator operator-(stride_counting_iterator i, difference_type const n)
requires std::random_access_iterator<I>
{
return i -= n;
}
constexpr friend difference_type operator-(stride_counting_iterator const& x, stride_counting_iterator const& y)
friend constexpr difference_type operator-(stride_counting_iterator const& x, stride_counting_iterator const& y)
requires std::sized_sentinel_for<I, I>
{
return x.base() - y.base();
@ -884,25 +884,25 @@ public:
return base_ == last;
}
constexpr friend bool operator<(stride_counting_iterator const& x, stride_counting_iterator const& y)
friend constexpr bool operator<(stride_counting_iterator const& x, stride_counting_iterator const& y)
requires std::random_access_iterator<I>
{
return x.base_ < y.base_;
}
constexpr friend bool operator>(stride_counting_iterator const& x, stride_counting_iterator const& y)
friend constexpr bool operator>(stride_counting_iterator const& x, stride_counting_iterator const& y)
requires std::random_access_iterator<I>
{
return y < x;
}
constexpr friend bool operator<=(stride_counting_iterator const& x, stride_counting_iterator const& y)
friend constexpr bool operator<=(stride_counting_iterator const& x, stride_counting_iterator const& y)
requires std::random_access_iterator<I>
{
return !(y < x);
}
constexpr friend bool operator>=(stride_counting_iterator const& x, stride_counting_iterator const& y)
friend constexpr bool operator>=(stride_counting_iterator const& x, stride_counting_iterator const& y)
requires std::random_access_iterator<I>
{
return !(x < y);

View File

@ -34,7 +34,7 @@ public:
return *this;
}
constexpr friend void swap(lvalue_adl_swappable& x,
friend constexpr void swap(lvalue_adl_swappable& x,
lvalue_adl_swappable& y) noexcept {
std::ranges::swap(x.value_, y.value_);
}
@ -70,7 +70,7 @@ public:
return *this;
}
constexpr friend void swap(lvalue_rvalue_adl_swappable& x,
friend constexpr void swap(lvalue_rvalue_adl_swappable& x,
lvalue_rvalue_adl_swappable&& y) noexcept {
std::ranges::swap(x.value_, y.value_);
}
@ -107,7 +107,7 @@ public:
return *this;
}
constexpr friend void swap(rvalue_lvalue_adl_swappable&& x,
friend constexpr void swap(rvalue_lvalue_adl_swappable&& x,
rvalue_lvalue_adl_swappable& y) noexcept {
std::ranges::swap(x.value_, y.value_);
}
@ -142,7 +142,7 @@ public:
return *this;
}
constexpr friend void swap(rvalue_adl_swappable&& x,
friend constexpr void swap(rvalue_adl_swappable&& x,
rvalue_adl_swappable&& y) noexcept {
std::ranges::swap(x.value_, y.value_);
}
@ -179,7 +179,7 @@ public:
return *this;
}
constexpr friend void swap(non_move_constructible_adl_swappable& x,
friend constexpr void swap(non_move_constructible_adl_swappable& x,
non_move_constructible_adl_swappable& y) noexcept {
std::ranges::swap(x.value_, y.value_);
}
@ -212,7 +212,7 @@ public:
constexpr non_move_assignable_adl_swappable&
operator=(non_move_assignable_adl_swappable&& other) noexcept = delete;
constexpr friend void swap(non_move_assignable_adl_swappable& x,
friend constexpr void swap(non_move_assignable_adl_swappable& x,
non_move_assignable_adl_swappable& y) noexcept {
std::ranges::swap(x.value_, y.value_);
}
@ -248,7 +248,7 @@ public:
return *this;
}
constexpr friend void swap(throwable_adl_swappable& X,
friend constexpr void swap(throwable_adl_swappable& X,
throwable_adl_swappable& Y) noexcept(false) {
std::ranges::swap(X.value_, Y.value_);
}