Remove `_NODISCARD_FRIEND` workaround (#4782)

Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
This commit is contained in:
Igor Zhukov 2024-07-05 14:16:13 +07:00 коммит произвёл GitHub
Родитель 4406e0e251
Коммит 184ce39eef
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
29 изменённых файлов: 468 добавлений и 474 удалений

Просмотреть файл

@ -328,18 +328,18 @@ struct
}
#if _HAS_CXX20
_NODISCARD_FRIEND constexpr bool operator==(const _Base128&, const _Base128&) noexcept = default;
_NODISCARD friend constexpr bool operator==(const _Base128&, const _Base128&) noexcept = default;
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
_NODISCARD_FRIEND constexpr bool operator==(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr bool operator==(const _Base128& _Left, const _Base128& _Right) noexcept {
return _Left._Word[0] == _Right._Word[0] && _Left._Word[1] == _Right._Word[1];
}
_NODISCARD_FRIEND constexpr bool operator!=(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr bool operator!=(const _Base128& _Left, const _Base128& _Right) noexcept {
return !(_Left == _Right);
}
#endif // ^^^ !_HAS_CXX20 ^^^
_NODISCARD_FRIEND constexpr bool operator<(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr bool operator<(const _Base128& _Left, const _Base128& _Right) noexcept {
if (_Left._Word[1] < _Right._Word[1]) {
return true;
}
@ -349,23 +349,23 @@ struct
}
return _Left._Word[0] < _Right._Word[0];
}
_NODISCARD_FRIEND constexpr bool operator>(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr bool operator>(const _Base128& _Left, const _Base128& _Right) noexcept {
return _Right < _Left;
}
_NODISCARD_FRIEND constexpr bool operator<=(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr bool operator<=(const _Base128& _Left, const _Base128& _Right) noexcept {
return !(_Right < _Left);
}
_NODISCARD_FRIEND constexpr bool operator>=(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr bool operator>=(const _Base128& _Left, const _Base128& _Right) noexcept {
return !(_Left < _Right);
}
_TEMPLATE_CLASS_INTEGRAL(_Ty)
_NODISCARD_FRIEND constexpr _Ty operator<<(const _Ty _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Ty operator<<(const _Ty _Left, const _Base128& _Right) noexcept {
return _Left << _Right._Word[0];
}
_TEMPLATE_CLASS_INTEGRAL(_Ty)
_NODISCARD_FRIEND constexpr _Ty operator>>(const _Ty _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Ty operator>>(const _Ty _Left, const _Base128& _Right) noexcept {
return _Left >> _Right._Word[0];
}
@ -720,7 +720,7 @@ struct _Unsigned128 : _Base128 {
}
#if _HAS_CXX20
_NODISCARD_FRIEND constexpr strong_ordering operator<=>(
_NODISCARD friend constexpr strong_ordering operator<=>(
const _Unsigned128& _Left, const _Unsigned128& _Right) noexcept {
strong_ordering _Ord = _Left._Word[1] <=> _Right._Word[1];
if (_Ord == strong_ordering::equal) {
@ -729,7 +729,7 @@ struct _Unsigned128 : _Base128 {
return _Ord;
}
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
_NODISCARD_FRIEND constexpr bool operator<(const _Unsigned128& _Left, const _Unsigned128& _Right) noexcept {
_NODISCARD friend constexpr bool operator<(const _Unsigned128& _Left, const _Unsigned128& _Right) noexcept {
if (_Left._Word[1] < _Right._Word[1]) {
return true;
}
@ -741,20 +741,20 @@ struct _Unsigned128 : _Base128 {
return _Left._Word[0] < _Right._Word[0];
}
_NODISCARD_FRIEND constexpr bool operator>(const _Unsigned128& _Left, const _Unsigned128& _Right) noexcept {
_NODISCARD friend constexpr bool operator>(const _Unsigned128& _Left, const _Unsigned128& _Right) noexcept {
return _Right < _Left;
}
_NODISCARD_FRIEND constexpr bool operator<=(const _Unsigned128& _Left, const _Unsigned128& _Right) noexcept {
_NODISCARD friend constexpr bool operator<=(const _Unsigned128& _Left, const _Unsigned128& _Right) noexcept {
return !(_Right < _Left);
}
_NODISCARD_FRIEND constexpr bool operator>=(const _Unsigned128& _Left, const _Unsigned128& _Right) noexcept {
_NODISCARD friend constexpr bool operator>=(const _Unsigned128& _Left, const _Unsigned128& _Right) noexcept {
return !(_Left < _Right);
}
#endif // ^^^ !_HAS_CXX20 ^^^
_NODISCARD_FRIEND constexpr _Unsigned128 operator<<(const _Unsigned128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator<<(const _Unsigned128& _Left, const _Base128& _Right) noexcept {
auto _Tmp{_Left};
_Tmp._Left_shift(static_cast<unsigned char>(_Right._Word[0]));
return _Tmp;
@ -770,7 +770,7 @@ struct _Unsigned128 : _Base128 {
return *this;
}
_NODISCARD_FRIEND constexpr _Unsigned128 operator>>(const _Unsigned128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator>>(const _Unsigned128& _Left, const _Base128& _Right) noexcept {
auto _Tmp{_Left};
_Tmp._Unsigned_right_shift(static_cast<unsigned char>(_Right._Word[0]));
return _Tmp;
@ -822,7 +822,7 @@ struct _Unsigned128 : _Base128 {
return _Unsigned128{~_Word[0], ~_Word[1]};
}
_NODISCARD_FRIEND constexpr _Unsigned128 operator+(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator+(const _Base128& _Left, const _Base128& _Right) noexcept {
_Unsigned128 _Result;
const auto _Carry = _AddCarry64(0, _Left._Word[0], _Right._Word[0], _Result._Word[0]);
_AddCarry64(_Carry, _Left._Word[1], _Right._Word[1], _Result._Word[1]);
@ -840,7 +840,7 @@ struct _Unsigned128 : _Base128 {
return _Left;
}
_NODISCARD_FRIEND constexpr _Unsigned128 operator-(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator-(const _Base128& _Left, const _Base128& _Right) noexcept {
_Unsigned128 _Result;
const auto _Borrow = _SubBorrow64(0, _Left._Word[0], _Right._Word[0], _Result._Word[0]);
_SubBorrow64(_Borrow, _Left._Word[1], _Right._Word[1], _Result._Word[1]);
@ -858,7 +858,7 @@ struct _Unsigned128 : _Base128 {
return _Left;
}
_NODISCARD_FRIEND constexpr _Unsigned128 operator*(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator*(const _Base128& _Left, const _Base128& _Right) noexcept {
return _Unsigned128{_Base128::_Multiply(_Left, _Right)};
}
@ -873,7 +873,7 @@ struct _Unsigned128 : _Base128 {
}
_TEMPLATE_CLASS_INTEGRAL(_Ty)
_NODISCARD_FRIEND constexpr _Unsigned128 operator/(const _Unsigned128& _Num, const _Ty _Den) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator/(const _Unsigned128& _Num, const _Ty _Den) noexcept {
#if !_STL_128_DIV_INTRINSICS
if constexpr (sizeof(_Ty) <= 4) {
return _Unsigned128{_Base128::_Divide(_Num, static_cast<uint32_t>(_Den))};
@ -883,7 +883,7 @@ struct _Unsigned128 : _Base128 {
return _Unsigned128{_Base128::_Divide(_Num, static_cast<uint64_t>(_Den))};
}
}
_NODISCARD_FRIEND constexpr _Unsigned128 operator/(const _Base128& _Num, const _Base128& _Den) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator/(const _Base128& _Num, const _Base128& _Den) noexcept {
return _Unsigned128{_Base128::_Divide(_Num, _Den)};
}
@ -914,7 +914,7 @@ struct _Unsigned128 : _Base128 {
}
_TEMPLATE_CLASS_INTEGRAL(_Ty)
_NODISCARD_FRIEND constexpr _Unsigned128 operator%(const _Base128& _Num, const _Ty _Den) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator%(const _Base128& _Num, const _Ty _Den) noexcept {
#if !_STL_128_DIV_INTRINSICS
if constexpr (sizeof(_Ty) <= 4) {
return _Unsigned128{_Base128::_Modulo(_Num, static_cast<uint32_t>(_Den))};
@ -924,7 +924,7 @@ struct _Unsigned128 : _Base128 {
return _Unsigned128{_Base128::_Modulo(_Num, static_cast<uint64_t>(_Den))};
}
}
_NODISCARD_FRIEND constexpr _Unsigned128 operator%(const _Base128& _Num, const _Base128& _Den) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator%(const _Base128& _Num, const _Base128& _Den) noexcept {
return _Unsigned128{_Base128::_Modulo(_Num, _Den)};
}
@ -945,7 +945,7 @@ struct _Unsigned128 : _Base128 {
return _Left;
}
_NODISCARD_FRIEND constexpr _Unsigned128 operator&(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator&(const _Base128& _Left, const _Base128& _Right) noexcept {
return _Unsigned128{_Left._Word[0] & _Right._Word[0], _Left._Word[1] & _Right._Word[1]};
}
@ -955,7 +955,7 @@ struct _Unsigned128 : _Base128 {
return *this;
}
_NODISCARD_FRIEND constexpr _Unsigned128 operator^(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator^(const _Base128& _Left, const _Base128& _Right) noexcept {
return _Unsigned128{_Left._Word[0] ^ _Right._Word[0], _Left._Word[1] ^ _Right._Word[1]};
}
@ -965,7 +965,7 @@ struct _Unsigned128 : _Base128 {
return *this;
}
_NODISCARD_FRIEND constexpr _Unsigned128 operator|(const _Base128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Unsigned128 operator|(const _Base128& _Left, const _Base128& _Right) noexcept {
return _Unsigned128{_Left._Word[0] | _Right._Word[0], _Left._Word[1] | _Right._Word[1]};
}
@ -1037,7 +1037,7 @@ struct _Signed128 : _Base128 {
}
#if _HAS_CXX20
_NODISCARD_FRIEND constexpr strong_ordering operator<=>(
_NODISCARD friend constexpr strong_ordering operator<=>(
const _Signed128& _Left, const _Signed128& _Right) noexcept {
strong_ordering _Ord = static_cast<int64_t>(_Left._Word[1]) <=> static_cast<int64_t>(_Right._Word[1]);
if (_Ord == strong_ordering::equal) {
@ -1046,7 +1046,7 @@ struct _Signed128 : _Base128 {
return _Ord;
}
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
_NODISCARD_FRIEND constexpr bool operator<(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_NODISCARD friend constexpr bool operator<(const _Signed128& _Left, const _Signed128& _Right) noexcept {
if (static_cast<int64_t>(_Left._Word[1]) < static_cast<int64_t>(_Right._Word[1])) {
return true;
}
@ -1058,20 +1058,20 @@ struct _Signed128 : _Base128 {
return _Left._Word[0] < _Right._Word[0];
}
_NODISCARD_FRIEND constexpr bool operator>(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_NODISCARD friend constexpr bool operator>(const _Signed128& _Left, const _Signed128& _Right) noexcept {
return _Right < _Left;
}
_NODISCARD_FRIEND constexpr bool operator<=(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_NODISCARD friend constexpr bool operator<=(const _Signed128& _Left, const _Signed128& _Right) noexcept {
return !(_Right < _Left);
}
_NODISCARD_FRIEND constexpr bool operator>=(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_NODISCARD friend constexpr bool operator>=(const _Signed128& _Left, const _Signed128& _Right) noexcept {
return !(_Left < _Right);
}
#endif // ^^^ !_HAS_CXX20 ^^^
_NODISCARD_FRIEND constexpr _Signed128 operator<<(const _Signed128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator<<(const _Signed128& _Left, const _Base128& _Right) noexcept {
auto _Tmp{_Left};
_Tmp._Left_shift(static_cast<unsigned char>(_Right._Word[0]));
return _Tmp;
@ -1110,7 +1110,7 @@ struct _Signed128 : _Base128 {
_Word[1] = static_cast<uint64_t>(static_cast<int64_t>(_Word[1]) >> _Count);
}
_NODISCARD_FRIEND constexpr _Signed128 operator>>(const _Signed128& _Left, const _Base128& _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator>>(const _Signed128& _Left, const _Base128& _Right) noexcept {
auto _Tmp{_Left};
_Tmp._Signed_right_shift(static_cast<unsigned char>(_Right._Word[0]));
return _Tmp;
@ -1162,7 +1162,7 @@ struct _Signed128 : _Base128 {
return _Signed128{~_Word[0], ~_Word[1]};
}
_NODISCARD_FRIEND constexpr _Signed128 operator+(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator+(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_Signed128 _Result;
const auto _Carry = _AddCarry64(0, _Left._Word[0], _Right._Word[0], _Result._Word[0]);
_AddCarry64(_Carry, _Left._Word[1], _Right._Word[1], _Result._Word[1]);
@ -1180,7 +1180,7 @@ struct _Signed128 : _Base128 {
return _Left;
}
_NODISCARD_FRIEND constexpr _Signed128 operator-(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator-(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_Signed128 _Result;
const auto _Borrow = _SubBorrow64(0, _Left._Word[0], _Right._Word[0], _Result._Word[0]);
_SubBorrow64(_Borrow, _Left._Word[1], _Right._Word[1], _Result._Word[1]);
@ -1205,7 +1205,7 @@ struct _Signed128 : _Base128 {
}
}
_NODISCARD_FRIEND constexpr _Signed128 operator*(_Signed128 _Left, _Signed128 _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator*(_Signed128 _Left, _Signed128 _Right) noexcept {
bool _Negative = false;
_Left._Strip_negative(_Negative);
_Right._Strip_negative(_Negative);
@ -1236,7 +1236,7 @@ struct _Signed128 : _Base128 {
}
_TEMPLATE_CLASS_INTEGRAL(_Ty)
_NODISCARD_FRIEND constexpr _Signed128 operator/(_Signed128 _Num, _Ty _Den) noexcept {
_NODISCARD friend constexpr _Signed128 operator/(_Signed128 _Num, _Ty _Den) noexcept {
bool _Negative = false;
_Num._Strip_negative(_Negative);
if constexpr (is_signed_v<_Ty>) {
@ -1261,7 +1261,7 @@ struct _Signed128 : _Base128 {
}
return _Result;
}
_NODISCARD_FRIEND constexpr _Signed128 operator/(_Signed128 _Num, _Signed128 _Den) noexcept {
_NODISCARD friend constexpr _Signed128 operator/(_Signed128 _Num, _Signed128 _Den) noexcept {
bool _Negative = false;
_Num._Strip_negative(_Negative);
_Den._Strip_negative(_Negative);
@ -1291,7 +1291,7 @@ struct _Signed128 : _Base128 {
return _Left;
}
_NODISCARD_FRIEND constexpr _Signed128 operator%(_Signed128 _Left, _Signed128 _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator%(_Signed128 _Left, _Signed128 _Right) noexcept {
bool _Negative = false;
_Left._Strip_negative(_Negative);
@ -1308,7 +1308,7 @@ struct _Signed128 : _Base128 {
}
_TEMPLATE_CLASS_INTEGRAL(_Ty)
_NODISCARD_FRIEND constexpr _Signed128 operator%(_Signed128 _Left, const _Ty _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator%(_Signed128 _Left, const _Ty _Right) noexcept {
return _Left % _Signed128{_Right};
}
@ -1331,7 +1331,7 @@ struct _Signed128 : _Base128 {
return _Left;
}
_NODISCARD_FRIEND constexpr _Signed128 operator&(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator&(const _Signed128& _Left, const _Signed128& _Right) noexcept {
return _Signed128{_Left._Word[0] & _Right._Word[0], _Left._Word[1] & _Right._Word[1]};
}
@ -1341,7 +1341,7 @@ struct _Signed128 : _Base128 {
return *this;
}
_NODISCARD_FRIEND constexpr _Signed128 operator^(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator^(const _Signed128& _Left, const _Signed128& _Right) noexcept {
return _Signed128{_Left._Word[0] ^ _Right._Word[0], _Left._Word[1] ^ _Right._Word[1]};
}
@ -1351,7 +1351,7 @@ struct _Signed128 : _Base128 {
return *this;
}
_NODISCARD_FRIEND constexpr _Signed128 operator|(const _Signed128& _Left, const _Signed128& _Right) noexcept {
_NODISCARD friend constexpr _Signed128 operator|(const _Signed128& _Left, const _Signed128& _Right) noexcept {
return _Signed128{_Left._Word[0] | _Right._Word[0], _Left._Word[1] | _Right._Word[1]};
}

Просмотреть файл

@ -827,7 +827,7 @@ namespace ranges {
return _STD invoke(*_Parent->_Fun, _Current[_Idx]);
}
_NODISCARD_FRIEND constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept(
_NODISCARD friend constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Left._Current == _Right._Current)) /* strengthened */
requires equality_comparable<iterator_t<_Base>>
{
@ -837,7 +837,7 @@ namespace ranges {
return _Left._Current == _Right._Current;
}
_NODISCARD_FRIEND constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept(
_NODISCARD friend constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Left._Current < _Right._Current)) /* strengthened */
requires random_access_range<_Base>
{
@ -846,25 +846,25 @@ namespace ranges {
#endif // _ITERATOR_DEBUG_LEVEL != 0
return _Left._Current < _Right._Current;
}
_NODISCARD_FRIEND constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept(
_NODISCARD friend constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Left._Current < _Right._Current)) /* strengthened */
requires random_access_range<_Base>
{
return _Right < _Left;
}
_NODISCARD_FRIEND constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
_NODISCARD friend constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Left._Current < _Right._Current)) /* strengthened */
requires random_access_range<_Base>
{
return !(_Right < _Left);
}
_NODISCARD_FRIEND constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
_NODISCARD friend constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Left._Current < _Right._Current)) /* strengthened */
requires random_access_range<_Base>
{
return !(_Left < _Right);
}
_NODISCARD_FRIEND constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) noexcept(
_NODISCARD friend constexpr auto operator<=>(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Left._Current <=> _Right._Current)) /* strengthened */
requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>>
{
@ -874,7 +874,7 @@ namespace ranges {
return _Left._Current <=> _Right._Current;
}
_NODISCARD_FRIEND constexpr _Iterator operator+(_Iterator _It, const difference_type _Off) noexcept(
_NODISCARD friend constexpr _Iterator operator+(_Iterator _It, const difference_type _Off) noexcept(
noexcept(_It._Current += _Off)) /* strengthened */
requires random_access_range<_Base>
{
@ -884,7 +884,7 @@ namespace ranges {
_It._Current += _Off;
return _It;
}
_NODISCARD_FRIEND constexpr _Iterator operator+(const difference_type _Off, _Iterator _It) noexcept(
_NODISCARD friend constexpr _Iterator operator+(const difference_type _Off, _Iterator _It) noexcept(
noexcept(_It._Current += _Off)) /* strengthened */
requires random_access_range<_Base>
{
@ -895,7 +895,7 @@ namespace ranges {
return _It;
}
_NODISCARD_FRIEND constexpr _Iterator operator-(_Iterator _It, const difference_type _Off) noexcept(
_NODISCARD friend constexpr _Iterator operator-(_Iterator _It, const difference_type _Off) noexcept(
noexcept(_It._Current -= _Off)) /* strengthened */
requires random_access_range<_Base>
{
@ -907,7 +907,7 @@ namespace ranges {
return _It;
}
_NODISCARD_FRIEND constexpr difference_type operator-(const _Iterator& _Left,
_NODISCARD friend constexpr difference_type operator-(const _Iterator& _Left,
const _Iterator& _Right) noexcept(noexcept(_Left._Current - _Right._Current)) /* strengthened */
requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>>
{
@ -958,14 +958,14 @@ namespace ranges {
template <bool _OtherConst>
requires sentinel_for<sentinel_t<_Base>, _Maybe_const_iter<_OtherConst>>
_NODISCARD_FRIEND constexpr bool operator==(const _Iterator<_OtherConst>& _Left,
_NODISCARD friend constexpr bool operator==(const _Iterator<_OtherConst>& _Left,
const _Sentinel& _Right) noexcept(noexcept(_Get_current(_Left) == _Right._Last)) /* strengthened */ {
return _Get_current(_Left) == _Right._Last;
}
template <bool _OtherConst>
requires sized_sentinel_for<sentinel_t<_Base>, _Maybe_const_iter<_OtherConst>>
_NODISCARD_FRIEND constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-(
_NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>> operator-(
const _Iterator<_OtherConst>& _Left,
const _Sentinel& _Right) noexcept(noexcept(_Get_current(_Left) - _Right._Last)) /* strengthened */ {
return _Get_current(_Left) - _Right._Last;
@ -973,7 +973,7 @@ namespace ranges {
template <bool _OtherConst>
requires sized_sentinel_for<sentinel_t<_Base>, _Maybe_const_iter<_OtherConst>>
_NODISCARD_FRIEND constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>>
_NODISCARD friend constexpr range_difference_t<_Maybe_const<_OtherConst, _Vw>>
operator-(const _Sentinel& _Left, const _Iterator<_OtherConst>& _Right) noexcept(
noexcept(_Left._Last - _Get_current(_Right))) /* strengthened */ {
return _Left._Last - _Get_current(_Right);

Просмотреть файл

@ -990,7 +990,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND constexpr _String_view_iterator operator+(
_NODISCARD friend constexpr _String_view_iterator operator+(
const difference_type _Off, _String_view_iterator _Right) noexcept {
_Right += _Off;
return _Right;

Просмотреть файл

@ -252,7 +252,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _CONSTEXPR17 _Array_const_iterator operator+(
_NODISCARD friend _CONSTEXPR17 _Array_const_iterator operator+(
const ptrdiff_t _Off, _Array_const_iterator _Next) noexcept {
_Next += _Off;
return _Next;
@ -360,7 +360,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _CONSTEXPR17 _Array_iterator operator+(const ptrdiff_t _Off, _Array_iterator _Next) noexcept {
_NODISCARD friend _CONSTEXPR17 _Array_iterator operator+(const ptrdiff_t _Off, _Array_iterator _Next) noexcept {
_Next += _Off;
return _Next;
}

Просмотреть файл

@ -208,7 +208,7 @@ _EXPORT_STD struct from_chars_result {
const char* ptr;
errc ec;
#if _HAS_CXX20
_NODISCARD_FRIEND bool operator==(const from_chars_result&, const from_chars_result&) = default;
_NODISCARD friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
#endif // _HAS_CXX20
};

Просмотреть файл

@ -47,52 +47,52 @@ _EXPORT_STD struct partial_ordering {
static const partial_ordering greater;
static const partial_ordering unordered;
_NODISCARD_FRIEND constexpr bool operator==(const partial_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator==(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val._Value == 0;
}
_NODISCARD_FRIEND constexpr bool operator==(partial_ordering, partial_ordering) noexcept = default;
_NODISCARD friend constexpr bool operator==(partial_ordering, partial_ordering) noexcept = default;
_NODISCARD_FRIEND constexpr bool operator<(const partial_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator<(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val._Value == static_cast<_Compare_t>(_Compare_ord::less);
}
_NODISCARD_FRIEND constexpr bool operator>(const partial_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator>(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val._Value > 0;
}
_NODISCARD_FRIEND constexpr bool operator<=(const partial_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator<=(const partial_ordering _Val, _Literal_zero) noexcept {
// The stored value is either less (0xff), equivalent (0x00), greater (0x01), or unordered (0x80).
// Subtracting from 0 produces either 0x01, 0x00, 0xff, or 0x80. The result is greater than or equal to 0
// if and only if the initial value was less or equivalent, for which we want to return true.
return static_cast<signed char>(0 - static_cast<unsigned int>(_Val._Value)) >= 0;
}
_NODISCARD_FRIEND constexpr bool operator>=(const partial_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator>=(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val._Value >= 0;
}
_NODISCARD_FRIEND constexpr bool operator<(_Literal_zero, const partial_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator<(_Literal_zero, const partial_ordering _Val) noexcept {
return _Val > 0;
}
_NODISCARD_FRIEND constexpr bool operator>(_Literal_zero, const partial_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator>(_Literal_zero, const partial_ordering _Val) noexcept {
return _Val < 0;
}
_NODISCARD_FRIEND constexpr bool operator<=(_Literal_zero, const partial_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator<=(_Literal_zero, const partial_ordering _Val) noexcept {
return _Val >= 0;
}
_NODISCARD_FRIEND constexpr bool operator>=(_Literal_zero, const partial_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator>=(_Literal_zero, const partial_ordering _Val) noexcept {
return _Val <= 0;
}
_NODISCARD_FRIEND constexpr partial_ordering operator<=>(const partial_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr partial_ordering operator<=>(const partial_ordering _Val, _Literal_zero) noexcept {
return _Val;
}
_NODISCARD_FRIEND constexpr partial_ordering operator<=>(_Literal_zero, const partial_ordering _Val) noexcept {
_NODISCARD friend constexpr partial_ordering operator<=>(_Literal_zero, const partial_ordering _Val) noexcept {
// The stored value is either less (0xff), equivalent (0x00), greater (0x01), or unordered (0x80).
// Subtracting from 0 produces either 0x01, 0x00, 0xff, or 0x80. Note that the effect is to
// exchange less for greater (and vice versa), while leaving equivalent and unordered unchanged.
@ -116,49 +116,49 @@ _EXPORT_STD struct weak_ordering {
return {static_cast<_Compare_t>(_Value)};
}
_NODISCARD_FRIEND constexpr bool operator==(const weak_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator==(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value == 0;
}
_NODISCARD_FRIEND constexpr bool operator==(weak_ordering, weak_ordering) noexcept = default;
_NODISCARD friend constexpr bool operator==(weak_ordering, weak_ordering) noexcept = default;
_NODISCARD_FRIEND constexpr bool operator<(const weak_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator<(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value < 0;
}
_NODISCARD_FRIEND constexpr bool operator>(const weak_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator>(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value > 0;
}
_NODISCARD_FRIEND constexpr bool operator<=(const weak_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator<=(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value <= 0;
}
_NODISCARD_FRIEND constexpr bool operator>=(const weak_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator>=(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val._Value >= 0;
}
_NODISCARD_FRIEND constexpr bool operator<(_Literal_zero, const weak_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator<(_Literal_zero, const weak_ordering _Val) noexcept {
return _Val > 0;
}
_NODISCARD_FRIEND constexpr bool operator>(_Literal_zero, const weak_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator>(_Literal_zero, const weak_ordering _Val) noexcept {
return _Val < 0;
}
_NODISCARD_FRIEND constexpr bool operator<=(_Literal_zero, const weak_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator<=(_Literal_zero, const weak_ordering _Val) noexcept {
return _Val >= 0;
}
_NODISCARD_FRIEND constexpr bool operator>=(_Literal_zero, const weak_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator>=(_Literal_zero, const weak_ordering _Val) noexcept {
return _Val <= 0;
}
_NODISCARD_FRIEND constexpr weak_ordering operator<=>(const weak_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr weak_ordering operator<=>(const weak_ordering _Val, _Literal_zero) noexcept {
return _Val;
}
_NODISCARD_FRIEND constexpr weak_ordering operator<=>(_Literal_zero, const weak_ordering _Val) noexcept {
_NODISCARD friend constexpr weak_ordering operator<=>(_Literal_zero, const weak_ordering _Val) noexcept {
return {static_cast<_Compare_t>(-_Val._Value)};
}
@ -183,49 +183,49 @@ _EXPORT_STD struct strong_ordering {
return {static_cast<_Compare_t>(_Value)};
}
_NODISCARD_FRIEND constexpr bool operator==(const strong_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator==(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value == 0;
}
_NODISCARD_FRIEND constexpr bool operator==(strong_ordering, strong_ordering) noexcept = default;
_NODISCARD friend constexpr bool operator==(strong_ordering, strong_ordering) noexcept = default;
_NODISCARD_FRIEND constexpr bool operator<(const strong_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator<(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value < 0;
}
_NODISCARD_FRIEND constexpr bool operator>(const strong_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator>(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value > 0;
}
_NODISCARD_FRIEND constexpr bool operator<=(const strong_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator<=(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value <= 0;
}
_NODISCARD_FRIEND constexpr bool operator>=(const strong_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr bool operator>=(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val._Value >= 0;
}
_NODISCARD_FRIEND constexpr bool operator<(_Literal_zero, const strong_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator<(_Literal_zero, const strong_ordering _Val) noexcept {
return _Val > 0;
}
_NODISCARD_FRIEND constexpr bool operator>(_Literal_zero, const strong_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator>(_Literal_zero, const strong_ordering _Val) noexcept {
return _Val < 0;
}
_NODISCARD_FRIEND constexpr bool operator<=(_Literal_zero, const strong_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator<=(_Literal_zero, const strong_ordering _Val) noexcept {
return _Val >= 0;
}
_NODISCARD_FRIEND constexpr bool operator>=(_Literal_zero, const strong_ordering _Val) noexcept {
_NODISCARD friend constexpr bool operator>=(_Literal_zero, const strong_ordering _Val) noexcept {
return _Val <= 0;
}
_NODISCARD_FRIEND constexpr strong_ordering operator<=>(const strong_ordering _Val, _Literal_zero) noexcept {
_NODISCARD friend constexpr strong_ordering operator<=>(const strong_ordering _Val, _Literal_zero) noexcept {
return _Val;
}
_NODISCARD_FRIEND constexpr strong_ordering operator<=>(_Literal_zero, const strong_ordering _Val) noexcept {
_NODISCARD friend constexpr strong_ordering operator<=>(_Literal_zero, const strong_ordering _Val) noexcept {
return {static_cast<_Compare_t>(-_Val._Value)};
}

Просмотреть файл

@ -82,7 +82,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _Deque_unchecked_const_iterator operator+(
_NODISCARD friend _Deque_unchecked_const_iterator operator+(
const difference_type _Off, _Deque_unchecked_const_iterator _Next) noexcept {
_Next += _Off;
return _Next;
@ -202,7 +202,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _Deque_unchecked_iterator operator+(
_NODISCARD friend _Deque_unchecked_iterator operator+(
const difference_type _Off, _Deque_unchecked_iterator _Next) noexcept {
_Next += _Off;
return _Next;
@ -323,7 +323,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _Deque_const_iterator operator+(
_NODISCARD friend _Deque_const_iterator operator+(
const difference_type _Off, _Deque_const_iterator _Next) noexcept {
_Next += _Off;
return _Next;
@ -484,7 +484,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _Deque_iterator operator+(const difference_type _Off, _Deque_iterator _Next) noexcept {
_NODISCARD friend _Deque_iterator operator+(const difference_type _Off, _Deque_iterator _Next) noexcept {
_Next += _Off;
return _Next;
}

Просмотреть файл

@ -269,28 +269,28 @@ public:
__ExceptionPtrSwap(&_Lhs, &_Rhs);
}
_NODISCARD_FRIEND bool operator==(const exception_ptr& _Lhs, const exception_ptr& _Rhs) noexcept {
_NODISCARD friend bool operator==(const exception_ptr& _Lhs, const exception_ptr& _Rhs) noexcept {
return __ExceptionPtrCompare(&_Lhs, &_Rhs);
}
_NODISCARD_FRIEND bool operator==(const exception_ptr& _Lhs, nullptr_t) noexcept {
_NODISCARD friend bool operator==(const exception_ptr& _Lhs, nullptr_t) noexcept {
return !_Lhs;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator==(nullptr_t, const exception_ptr& _Rhs) noexcept {
_NODISCARD friend bool operator==(nullptr_t, const exception_ptr& _Rhs) noexcept {
return !_Rhs;
}
_NODISCARD_FRIEND bool operator!=(const exception_ptr& _Lhs, const exception_ptr& _Rhs) noexcept {
_NODISCARD friend bool operator!=(const exception_ptr& _Lhs, const exception_ptr& _Rhs) noexcept {
return !(_Lhs == _Rhs);
}
_NODISCARD_FRIEND bool operator!=(const exception_ptr& _Lhs, nullptr_t) noexcept {
_NODISCARD friend bool operator!=(const exception_ptr& _Lhs, nullptr_t) noexcept {
return !(_Lhs == nullptr);
}
_NODISCARD_FRIEND bool operator!=(nullptr_t, const exception_ptr& _Rhs) noexcept {
_NODISCARD friend bool operator!=(nullptr_t, const exception_ptr& _Rhs) noexcept {
return !(nullptr == _Rhs);
}
#endif // !_HAS_CXX20

Просмотреть файл

@ -98,7 +98,7 @@ public:
// [expected.un.eq]
template <class _UErr>
_NODISCARD_FRIEND constexpr bool operator==(const unexpected& _Left, const unexpected<_UErr>& _Right) noexcept(
_NODISCARD friend constexpr bool operator==(const unexpected& _Left, const unexpected<_UErr>& _Right) noexcept(
noexcept(_STD _Fake_copy_init<bool>(_Left._Unexpected == _Right.error()))) /* strengthened */ {
return _Left._Unexpected == _Right.error();
}
@ -1140,7 +1140,7 @@ public:
// [expected.object.eq]
template <class _Uty, class _UErr>
requires (!is_void_v<_Uty>)
_NODISCARD_FRIEND constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) noexcept(
_NODISCARD friend constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) noexcept(
noexcept(_STD _Fake_copy_init<bool>(_Left._Value == *_Right)) && noexcept(
_STD _Fake_copy_init<bool>(_Left._Unexpected == _Right.error()))) /* strengthened */ {
if (_Left._Has_value != _Right.has_value()) {
@ -1153,7 +1153,7 @@ public:
}
template <class _Uty>
_NODISCARD_FRIEND constexpr bool operator==(const expected& _Left, const _Uty& _Right) noexcept(
_NODISCARD friend constexpr bool operator==(const expected& _Left, const _Uty& _Right) noexcept(
noexcept(static_cast<bool>(_Left._Value == _Right))) /* strengthened */ {
if (_Left._Has_value) {
return static_cast<bool>(_Left._Value == _Right);
@ -1163,7 +1163,7 @@ public:
}
template <class _UErr>
_NODISCARD_FRIEND constexpr bool operator==(const expected& _Left, const unexpected<_UErr>& _Right) noexcept(
_NODISCARD friend constexpr bool operator==(const expected& _Left, const unexpected<_UErr>& _Right) noexcept(
noexcept(static_cast<bool>(_Left._Unexpected == _Right.error()))) /* strengthened */ {
if (_Left._Has_value) {
return false;
@ -1876,7 +1876,7 @@ public:
// [expected.void.eq]
template <class _Uty, class _UErr>
requires is_void_v<_Uty>
_NODISCARD_FRIEND constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) noexcept(
_NODISCARD friend constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) noexcept(
noexcept(static_cast<bool>(_Left._Unexpected == _Right.error()))) /* strengthened */ {
if (_Left._Has_value != _Right.has_value()) {
return false;
@ -1886,7 +1886,7 @@ public:
}
template <class _UErr>
_NODISCARD_FRIEND constexpr bool operator==(const expected& _Left, const unexpected<_UErr>& _Right) noexcept(
_NODISCARD friend constexpr bool operator==(const expected& _Left, const unexpected<_UErr>& _Right) noexcept(
noexcept(static_cast<bool>(_Left._Unexpected == _Right.error()))) /* strengthened */ {
if (_Left._Has_value) {
return false;

Просмотреть файл

@ -1346,37 +1346,37 @@ namespace filesystem {
return _Istr;
}
_NODISCARD_FRIEND bool operator==(const path& _Left, const path& _Right) noexcept {
_NODISCARD friend bool operator==(const path& _Left, const path& _Right) noexcept {
return _Left.compare(_Right._Text) == 0;
}
#if _HAS_CXX20
_NODISCARD_FRIEND strong_ordering operator<=>(const path& _Left, const path& _Right) noexcept {
_NODISCARD friend strong_ordering operator<=>(const path& _Left, const path& _Right) noexcept {
return _Left.compare(_Right._Text) <=> 0;
}
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
_NODISCARD_FRIEND bool operator!=(const path& _Left, const path& _Right) noexcept {
_NODISCARD friend bool operator!=(const path& _Left, const path& _Right) noexcept {
return _Left.compare(_Right) != 0;
}
_NODISCARD_FRIEND bool operator<(const path& _Left, const path& _Right) noexcept {
_NODISCARD friend bool operator<(const path& _Left, const path& _Right) noexcept {
return _Left.compare(_Right) < 0;
}
_NODISCARD_FRIEND bool operator>(const path& _Left, const path& _Right) noexcept {
_NODISCARD friend bool operator>(const path& _Left, const path& _Right) noexcept {
return _Left.compare(_Right) > 0;
}
_NODISCARD_FRIEND bool operator<=(const path& _Left, const path& _Right) noexcept {
_NODISCARD friend bool operator<=(const path& _Left, const path& _Right) noexcept {
return _Left.compare(_Right) <= 0;
}
_NODISCARD_FRIEND bool operator>=(const path& _Left, const path& _Right) noexcept {
_NODISCARD friend bool operator>=(const path& _Left, const path& _Right) noexcept {
return _Left.compare(_Right) >= 0;
}
#endif // ^^^ !_HAS_CXX20 ^^^
_NODISCARD_FRIEND path operator/(const path& _Left, const path& _Right) { // append a pair of paths together
_NODISCARD friend path operator/(const path& _Left, const path& _Right) { // append a pair of paths together
const auto _Right_size = _Right._Text.size();
const auto _Right_first = _Right._Text.data();
const auto _Right_last = _Right_first + _Right_size;
@ -1578,12 +1578,12 @@ namespace filesystem {
return _Tmp;
}
_NODISCARD_FRIEND bool operator==(const _Path_iterator& _Lhs, const _Path_iterator& _Rhs) {
_NODISCARD friend bool operator==(const _Path_iterator& _Lhs, const _Path_iterator& _Rhs) {
return _Lhs._Position == _Rhs._Position;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const _Path_iterator& _Lhs, const _Path_iterator& _Rhs) {
_NODISCARD friend bool operator!=(const _Path_iterator& _Lhs, const _Path_iterator& _Rhs) {
return _Lhs._Position != _Rhs._Position;
}
#endif // !_HAS_CXX20
@ -1981,7 +1981,7 @@ namespace filesystem {
}
#if _HAS_CXX20
_NODISCARD_FRIEND bool operator==(const file_status& _Lhs, const file_status& _Rhs) noexcept {
_NODISCARD friend bool operator==(const file_status& _Lhs, const file_status& _Rhs) noexcept {
return _Lhs._Myftype == _Rhs._Myftype && _Lhs._Myperms == _Rhs._Myperms;
}
#endif // _HAS_CXX20
@ -3719,7 +3719,7 @@ namespace filesystem {
uintmax_t available;
#if _HAS_CXX20
_NODISCARD_FRIEND constexpr bool operator==(const space_info&, const space_info&) noexcept = default;
_NODISCARD friend constexpr bool operator==(const space_info&, const space_info&) noexcept = default;
#endif // _HAS_CXX20
};

Просмотреть файл

@ -1946,7 +1946,7 @@ public:
_Fn1._Swap(_Fn2);
}
_NODISCARD_FRIEND bool operator==(const move_only_function& _This, nullptr_t) noexcept {
_NODISCARD friend bool operator==(const move_only_function& _This, nullptr_t) noexcept {
return _This._Is_null();
}
};

Просмотреть файл

@ -98,13 +98,13 @@ public:
}
template <class _Int, enable_if_t<is_integral_v<_Int>, int> = 0>
_NODISCARD_FRIEND bool operator==(const fpos& _Left, const _Int _Right) noexcept /* strengthened */ {
_NODISCARD friend bool operator==(const fpos& _Left, const _Int _Right) noexcept /* strengthened */ {
return static_cast<streamoff>(_Left) == _Right;
}
#if !_HAS_CXX20
template <class _Int, enable_if_t<is_integral_v<_Int>, int> = 0>
_NODISCARD_FRIEND bool operator==(const _Int _Left, const fpos& _Right) noexcept /* strengthened */ {
_NODISCARD friend bool operator==(const _Int _Left, const fpos& _Right) noexcept /* strengthened */ {
return _Left == static_cast<streamoff>(_Right);
}
@ -113,12 +113,12 @@ public:
}
template <class _Int, enable_if_t<is_integral_v<_Int>, int> = 0>
_NODISCARD_FRIEND bool operator!=(const fpos& _Left, const _Int _Right) noexcept /* strengthened */ {
_NODISCARD friend bool operator!=(const fpos& _Left, const _Int _Right) noexcept /* strengthened */ {
return static_cast<streamoff>(_Left) != _Right;
}
template <class _Int, enable_if_t<is_integral_v<_Int>, int> = 0>
_NODISCARD_FRIEND bool operator!=(const _Int _Left, const fpos& _Right) noexcept /* strengthened */ {
_NODISCARD friend bool operator!=(const _Int _Left, const fpos& _Right) noexcept /* strengthened */ {
return _Left != static_cast<streamoff>(_Right);
}
#endif // !_HAS_CXX20

Просмотреть файл

@ -285,7 +285,7 @@ public:
}
#if _HAS_CXX20
_NODISCARD_FRIEND bool operator==(const istream_iterator& _Left, default_sentinel_t) noexcept /* strengthened */ {
_NODISCARD friend bool operator==(const istream_iterator& _Left, default_sentinel_t) noexcept /* strengthened */ {
return !_Left._Myistr;
}
#endif // _HAS_CXX20
@ -448,7 +448,7 @@ public:
}
#if _HAS_CXX20
_NODISCARD_FRIEND bool operator==(const istreambuf_iterator& _Left, default_sentinel_t) {
_NODISCARD friend bool operator==(const istreambuf_iterator& _Left, default_sentinel_t) {
if (!_Left._Got) {
_Left._Peek();
}
@ -997,7 +997,7 @@ public:
template <class _OIter, sentinel_for<_Iter> _OSe>
requires sentinel_for<_Se, _OIter>
_NODISCARD_FRIEND constexpr bool operator==(
_NODISCARD friend constexpr bool operator==(
const common_iterator& _Left, const common_iterator<_OIter, _OSe>& _Right) {
auto& _Right_val = _Right._Get_val();
#if _ITERATOR_DEBUG_LEVEL != 0
@ -1027,7 +1027,7 @@ public:
template <sized_sentinel_for<_Iter> _OIter, sized_sentinel_for<_Iter> _OSe>
requires sized_sentinel_for<_Se, _OIter>
_NODISCARD_FRIEND constexpr iter_difference_t<_OIter> operator-(
_NODISCARD friend constexpr iter_difference_t<_OIter> operator-(
const common_iterator& _Left, const common_iterator<_OIter, _OSe>& _Right) {
auto& _Right_val = _Right._Get_val();
#if _ITERATOR_DEBUG_LEVEL != 0
@ -1051,7 +1051,7 @@ public:
}
}
_NODISCARD_FRIEND constexpr decltype(auto) iter_move(const common_iterator& _Right) noexcept(
_NODISCARD friend constexpr decltype(auto) iter_move(const common_iterator& _Right) noexcept(
noexcept(_RANGES iter_move(_Right._Val._Get_first())))
requires input_iterator<_Iter>
{
@ -1288,7 +1288,7 @@ public:
return counted_iterator{_Current + _Diff, static_cast<iter_difference_t<_Iter>>(_Length - _Diff)};
}
_NODISCARD_FRIEND constexpr counted_iterator operator+(
_NODISCARD friend constexpr counted_iterator operator+(
const iter_difference_t<_Iter> _Diff, const counted_iterator& _Right)
requires random_access_iterator<_Iter>
{
@ -1313,7 +1313,7 @@ public:
}
template <common_with<_Iter> _Other>
_NODISCARD_FRIEND constexpr iter_difference_t<_Other> operator-(
_NODISCARD friend constexpr iter_difference_t<_Other> operator-(
const counted_iterator& _Left, const counted_iterator<_Other>& _Right) noexcept /* strengthened */ {
#if _ITERATOR_DEBUG_LEVEL != 0
_Same_sequence(_Left, _Right);
@ -1321,12 +1321,12 @@ public:
return _Right.count() - _Left._Length;
}
_NODISCARD_FRIEND constexpr iter_difference_t<_Iter> operator-(
_NODISCARD friend constexpr iter_difference_t<_Iter> operator-(
const counted_iterator& _Left, default_sentinel_t) noexcept /* strengthened */ {
return -_Left._Length;
}
_NODISCARD_FRIEND constexpr iter_difference_t<_Iter> operator-(
_NODISCARD friend constexpr iter_difference_t<_Iter> operator-(
default_sentinel_t, const counted_iterator& _Right) noexcept /* strengthened */ {
return _Right._Length;
}
@ -1344,7 +1344,7 @@ public:
// [counted.iter.cmp]
template <common_with<_Iter> _Other>
_NODISCARD_FRIEND constexpr bool operator==(
_NODISCARD friend constexpr bool operator==(
const counted_iterator& _Left, const counted_iterator<_Other>& _Right) noexcept /* strengthened */ {
#if _ITERATOR_DEBUG_LEVEL != 0
_Same_sequence(_Left, _Right);
@ -1352,13 +1352,13 @@ public:
return _Left._Length == _Right.count();
}
_NODISCARD_FRIEND constexpr bool operator==(const counted_iterator& _Left, default_sentinel_t) noexcept
_NODISCARD friend constexpr bool operator==(const counted_iterator& _Left, default_sentinel_t) noexcept
/* strengthened */ {
return _Left._Length == 0;
}
template <common_with<_Iter> _Other>
_NODISCARD_FRIEND constexpr strong_ordering operator<=>(
_NODISCARD friend constexpr strong_ordering operator<=>(
const counted_iterator& _Left, const counted_iterator<_Other>& _Right) noexcept /* strengthened */ {
#if _ITERATOR_DEBUG_LEVEL != 0
_Same_sequence(_Left, _Right);
@ -1367,7 +1367,7 @@ public:
}
// [counted.iter.cust]
_NODISCARD_FRIEND constexpr decltype(auto) iter_move(const counted_iterator& _Right) noexcept(
_NODISCARD friend constexpr decltype(auto) iter_move(const counted_iterator& _Right) noexcept(
noexcept(_RANGES iter_move(_Right._Current)))
requires input_iterator<_Iter>
{
@ -1585,7 +1585,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND constexpr checked_array_iterator operator+(
_NODISCARD friend constexpr checked_array_iterator operator+(
const difference_type _Off, const checked_array_iterator<_Ptr>& _Next) noexcept {
return _Next + _Off;
}
@ -1776,7 +1776,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND constexpr unchecked_array_iterator operator+(
_NODISCARD friend constexpr unchecked_array_iterator operator+(
const difference_type _Off, const unchecked_array_iterator& _Next) noexcept {
return _Next + _Off;
}

Просмотреть файл

@ -253,7 +253,7 @@ public:
: extents(span{_Exts}, make_index_sequence<rank_dynamic()>{}) {}
template <class _OtherIndexType, size_t... _OtherExtents>
_NODISCARD_FRIEND constexpr bool operator==(
_NODISCARD friend constexpr bool operator==(
const extents& _Left, const extents<_OtherIndexType, _OtherExtents...>& _Right) noexcept {
if constexpr (rank() != sizeof...(_OtherExtents)) {
return false;
@ -603,7 +603,7 @@ public:
template <class _OtherExtents>
requires (extents_type::rank() == _OtherExtents::rank())
_NODISCARD_FRIEND constexpr bool operator==(const mapping& _Left, const mapping<_OtherExtents>& _Right) noexcept {
_NODISCARD friend constexpr bool operator==(const mapping& _Left, const mapping<_OtherExtents>& _Right) noexcept {
return _Left._Exts == _Right.extents();
}
@ -756,7 +756,7 @@ public:
template <class _OtherExtents>
requires (extents_type::rank() == _OtherExtents::rank())
_NODISCARD_FRIEND constexpr bool operator==(const mapping& _Left, const mapping<_OtherExtents>& _Right) noexcept {
_NODISCARD friend constexpr bool operator==(const mapping& _Left, const mapping<_OtherExtents>& _Right) noexcept {
return _Left._Exts == _Right.extents();
}
@ -986,7 +986,7 @@ public:
template <class _OtherMapping>
requires _Layout_mapping_alike<_OtherMapping> && (extents_type::rank() == _OtherMapping::extents_type::rank())
&& (_OtherMapping::is_always_strided())
_NODISCARD_FRIEND constexpr bool operator==(const mapping& _Left, const _OtherMapping& _Right) noexcept {
_NODISCARD friend constexpr bool operator==(const mapping& _Left, const _OtherMapping& _Right) noexcept {
if constexpr (extents_type::rank() != 0) {
if (_Left.extents() != _Right.extents()) {
return false;

Просмотреть файл

@ -620,14 +620,14 @@ public:
_Prev = _Temp;
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const linear_congruential_engine& _Lhs, const linear_congruential_engine& _Rhs) noexcept
/* strengthened */ {
return _Lhs._Prev == _Rhs._Prev;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const linear_congruential_engine& _Lhs, const linear_congruential_engine& _Rhs) noexcept
/* strengthened */ {
return _Lhs._Prev != _Rhs._Prev;
@ -711,13 +711,13 @@ public:
_Prev = _Temp;
}
_NODISCARD_FRIEND bool operator==(const linear_congruential& _Lhs, const linear_congruential& _Rhs) noexcept
_NODISCARD friend bool operator==(const linear_congruential& _Lhs, const linear_congruential& _Rhs) noexcept
/* strengthened */ {
return _Lhs._Prev == _Rhs._Prev;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const linear_congruential& _Lhs, const linear_congruential& _Rhs) noexcept
_NODISCARD friend bool operator!=(const linear_congruential& _Lhs, const linear_congruential& _Rhs) noexcept
/* strengthened */ {
return _Lhs._Prev != _Rhs._Prev;
}
@ -864,12 +864,12 @@ public:
}
}
_NODISCARD_FRIEND bool operator==(const _Swc_base& _Left, const _Swc_base& _Right) noexcept /* strengthened */ {
_NODISCARD friend bool operator==(const _Swc_base& _Left, const _Swc_base& _Right) noexcept /* strengthened */ {
return static_cast<const _Swc_base::_Mybase&>(_Left)._Equals(_Right) && _Left._Carry == _Right._Carry;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const _Swc_base& _Left, const _Swc_base& _Right) noexcept /* strengthened */ {
_NODISCARD friend bool operator!=(const _Swc_base& _Left, const _Swc_base& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
@ -1099,13 +1099,13 @@ public:
return _Mx - 1;
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const subtract_with_carry_engine& _Left, const subtract_with_carry_engine& _Right) noexcept /* strengthened */ {
return static_cast<const _Mybase&>(_Left) == static_cast<const _Mybase&>(_Right);
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const subtract_with_carry_engine& _Left, const subtract_with_carry_engine& _Right) noexcept /* strengthened */ {
return static_cast<const _Mybase&>(_Left) != static_cast<const _Mybase&>(_Right);
}
@ -1298,13 +1298,13 @@ public:
this->_Idx = _Nx;
}
_NODISCARD_FRIEND bool operator==(const mersenne_twister& _Left, const mersenne_twister& _Right) noexcept
_NODISCARD friend bool operator==(const mersenne_twister& _Left, const mersenne_twister& _Right) noexcept
/* strengthened */ {
return _Left._Equals(_Right);
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const mersenne_twister& _Left, const mersenne_twister& _Right) noexcept
_NODISCARD friend bool operator!=(const mersenne_twister& _Left, const mersenne_twister& _Right) noexcept
/* strengthened */ {
return !_Left._Equals(_Right);
}
@ -1501,13 +1501,13 @@ public:
return _Mybase::_WMSK;
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const mersenne_twister_engine& _Left, const mersenne_twister_engine& _Right) noexcept /* strengthened */ {
return static_cast<const _Mybase&>(_Left) == static_cast<const _Mybase&>(_Right);
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const mersenne_twister_engine& _Left, const mersenne_twister_engine& _Right) noexcept /* strengthened */ {
return static_cast<const _Mybase&>(_Left) != static_cast<const _Mybase&>(_Right);
}
@ -1604,12 +1604,12 @@ public:
}
}
_NODISCARD_FRIEND bool operator==(const discard_block& _Left, const discard_block& _Right) {
_NODISCARD friend bool operator==(const discard_block& _Left, const discard_block& _Right) {
return _Left._Eng == _Right._Eng && _Left._Nx == _Right._Nx;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const discard_block& _Left, const discard_block& _Right) {
_NODISCARD friend bool operator!=(const discard_block& _Left, const discard_block& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
@ -1685,12 +1685,12 @@ public:
}
}
_NODISCARD_FRIEND bool operator==(const _Discard_block_base& _Left, const _Discard_block_base& _Right) {
_NODISCARD friend bool operator==(const _Discard_block_base& _Left, const _Discard_block_base& _Right) {
return _Left._Eng == _Right._Eng && _Left._Nx == _Right._Nx;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const _Discard_block_base& _Left, const _Discard_block_base& _Right) {
_NODISCARD friend bool operator!=(const _Discard_block_base& _Left, const _Discard_block_base& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
@ -1771,12 +1771,12 @@ public:
return (_Engine::max)();
}
_NODISCARD_FRIEND bool operator==(const discard_block_engine& _Left, const discard_block_engine& _Right) {
_NODISCARD friend bool operator==(const discard_block_engine& _Left, const discard_block_engine& _Right) {
return static_cast<const _Mybase&>(_Left) == static_cast<const _Mybase&>(_Right);
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const discard_block_engine& _Left, const discard_block_engine& _Right) {
_NODISCARD friend bool operator!=(const discard_block_engine& _Left, const discard_block_engine& _Right) {
return static_cast<const _Mybase&>(_Left) != static_cast<const _Mybase&>(_Right);
}
#endif // !_HAS_CXX20
@ -1886,12 +1886,12 @@ public:
}
}
_NODISCARD_FRIEND bool operator==(const independent_bits_engine& _Left, const independent_bits_engine& _Right) {
_NODISCARD friend bool operator==(const independent_bits_engine& _Left, const independent_bits_engine& _Right) {
return _Left.base() == _Right.base();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const independent_bits_engine& _Left, const independent_bits_engine& _Right) {
_NODISCARD friend bool operator!=(const independent_bits_engine& _Left, const independent_bits_engine& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
@ -2016,12 +2016,12 @@ public:
}
}
_NODISCARD_FRIEND bool operator==(const shuffle_order_engine& _Left, const shuffle_order_engine& _Right) {
_NODISCARD friend bool operator==(const shuffle_order_engine& _Left, const shuffle_order_engine& _Right) {
return _Left.base() == _Right.base();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const shuffle_order_engine& _Left, const shuffle_order_engine& _Right) {
_NODISCARD friend bool operator!=(const shuffle_order_engine& _Left, const shuffle_order_engine& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
@ -2205,13 +2205,13 @@ public:
_Init(_Min0, _Max0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Min == _Right._Min && _Left._Max == _Right._Max;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -2413,13 +2413,13 @@ public:
return _Ostr << static_cast<const _Mybase&>(_Dist);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const uniform_int_distribution& _Left, const uniform_int_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const uniform_int_distribution& _Left, const uniform_int_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -2442,13 +2442,13 @@ public:
_Init(_Px0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Px == _Right._Px;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -2508,13 +2508,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const bernoulli_distribution& _Left, const bernoulli_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const bernoulli_distribution& _Left, const bernoulli_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -2602,13 +2602,13 @@ public:
_Init(_Px0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Px == _Right._Px;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -2669,13 +2669,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const geometric_distribution& _Left, const geometric_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const geometric_distribution& _Left, const geometric_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -2758,13 +2758,13 @@ public:
_Init(_Mean0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Mean == _Right._Mean;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -2832,13 +2832,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(const poisson_distribution& _Left, const poisson_distribution& _Right) noexcept
_NODISCARD friend bool operator==(const poisson_distribution& _Left, const poisson_distribution& _Right) noexcept
/* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const poisson_distribution& _Left, const poisson_distribution& _Right) noexcept
_NODISCARD friend bool operator!=(const poisson_distribution& _Left, const poisson_distribution& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -2913,13 +2913,13 @@ public:
_Init(_Tx0, _Px0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Tx == _Right._Tx && _Left._Px == _Right._Px;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3004,13 +3004,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(const binomial_distribution& _Left, const binomial_distribution& _Right) noexcept
_NODISCARD friend bool operator==(const binomial_distribution& _Left, const binomial_distribution& _Right) noexcept
/* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const binomial_distribution& _Left, const binomial_distribution& _Right) noexcept
_NODISCARD friend bool operator!=(const binomial_distribution& _Left, const binomial_distribution& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3114,13 +3114,13 @@ public:
_Init(_Min0, _Max0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Min == _Right._Min && _Left._Max == _Right._Max;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3304,13 +3304,13 @@ public:
return _Ostr << static_cast<const _Mybase&>(_Dist);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const uniform_real_distribution& _Left, const uniform_real_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const uniform_real_distribution& _Left, const uniform_real_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -3336,13 +3336,13 @@ public:
_Init(_Lambda0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Lambda == _Right._Lambda;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3401,13 +3401,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const exponential_distribution& _Left, const exponential_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const exponential_distribution& _Left, const exponential_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -3456,13 +3456,13 @@ public:
_Init(_Mean0, _Sigma0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Mean == _Right._Mean && _Left._Sigma == _Right._Sigma;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3542,13 +3542,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(const normal_distribution& _Left, const normal_distribution& _Right) noexcept
_NODISCARD friend bool operator==(const normal_distribution& _Left, const normal_distribution& _Right) noexcept
/* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const normal_distribution& _Left, const normal_distribution& _Right) noexcept
_NODISCARD friend bool operator!=(const normal_distribution& _Left, const normal_distribution& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3648,13 +3648,13 @@ public:
_Init(_Alpha0, _Beta0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Alpha == _Right._Alpha && _Left._Beta == _Right._Beta;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3729,13 +3729,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(const gamma_distribution& _Left, const gamma_distribution& _Right) noexcept
_NODISCARD friend bool operator==(const gamma_distribution& _Left, const gamma_distribution& _Right) noexcept
/* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const gamma_distribution& _Left, const gamma_distribution& _Right) noexcept
_NODISCARD friend bool operator!=(const gamma_distribution& _Left, const gamma_distribution& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3842,13 +3842,13 @@ public:
_Init(_Ax0, _Bx0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Ax == _Right._Ax && _Left._Bx == _Right._Bx;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3918,13 +3918,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(const weibull_distribution& _Left, const weibull_distribution& _Right) noexcept
_NODISCARD friend bool operator==(const weibull_distribution& _Left, const weibull_distribution& _Right) noexcept
/* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const weibull_distribution& _Left, const weibull_distribution& _Right) noexcept
_NODISCARD friend bool operator!=(const weibull_distribution& _Left, const weibull_distribution& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -3977,13 +3977,13 @@ public:
_Init(_Ax0, _Bx0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Ax == _Right._Ax && _Left._Bx == _Right._Bx;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -4052,13 +4052,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const extreme_value_distribution& _Left, const extreme_value_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const extreme_value_distribution& _Left, const extreme_value_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -4111,13 +4111,13 @@ public:
_Init(_Mx0, _Sx0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Mx == _Right._Mx && _Left._Sx == _Right._Sx;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -4186,13 +4186,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const lognormal_distribution& _Left, const lognormal_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const lognormal_distribution& _Left, const lognormal_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -4245,13 +4245,13 @@ public:
_Init(_Nx0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Nx == _Right._Nx;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -4310,13 +4310,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const chi_squared_distribution& _Left, const chi_squared_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const chi_squared_distribution& _Left, const chi_squared_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -4365,13 +4365,13 @@ public:
_Init(_Ax0, _Bx0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Ax == _Right._Ax && _Left._Bx == _Right._Bx;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -4440,13 +4440,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(const cauchy_distribution& _Left, const cauchy_distribution& _Right) noexcept
_NODISCARD friend bool operator==(const cauchy_distribution& _Left, const cauchy_distribution& _Right) noexcept
/* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const cauchy_distribution& _Left, const cauchy_distribution& _Right) noexcept
_NODISCARD friend bool operator!=(const cauchy_distribution& _Left, const cauchy_distribution& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -4558,13 +4558,13 @@ public:
_Init(_Mx0, _Nx0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Mx == _Right._Mx && _Left._Nx == _Right._Nx;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -4634,13 +4634,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(const fisher_f_distribution& _Left, const fisher_f_distribution& _Right) noexcept
_NODISCARD friend bool operator==(const fisher_f_distribution& _Left, const fisher_f_distribution& _Right) noexcept
/* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const fisher_f_distribution& _Left, const fisher_f_distribution& _Right) noexcept
_NODISCARD friend bool operator!=(const fisher_f_distribution& _Left, const fisher_f_distribution& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -4704,13 +4704,13 @@ public:
_Init(_Nx0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Nx == _Right._Nx;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -4769,13 +4769,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const student_t_distribution& _Left, const student_t_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const student_t_distribution& _Left, const student_t_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -4839,13 +4839,13 @@ public:
_Init(_Kx0, _Px0);
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return _Left._Kx == _Right._Kx && _Left._Px == _Right._Px;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) noexcept
/* strengthened */ {
return !(_Left == _Right);
}
@ -4915,13 +4915,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(const negative_binomial_distribution& _Left,
_NODISCARD friend bool operator==(const negative_binomial_distribution& _Left,
const negative_binomial_distribution& _Right) noexcept /* strengthened */ {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const negative_binomial_distribution& _Left,
_NODISCARD friend bool operator!=(const negative_binomial_distribution& _Left,
const negative_binomial_distribution& _Right) noexcept /* strengthened */ {
return !(_Left == _Right);
}
@ -5004,12 +5004,12 @@ public:
_Init();
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) {
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) {
return _Left._Pvec == _Right._Pvec;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) {
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
@ -5121,12 +5121,12 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(const discrete_distribution& _Left, const discrete_distribution& _Right) {
_NODISCARD friend bool operator==(const discrete_distribution& _Left, const discrete_distribution& _Right) {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const discrete_distribution& _Left, const discrete_distribution& _Right) {
_NODISCARD friend bool operator!=(const discrete_distribution& _Left, const discrete_distribution& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
@ -5213,13 +5213,13 @@ public:
}
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) {
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) {
return static_cast<const _Mypbase&>(_Left) == static_cast<const _Mypbase&>(_Right)
&& _Left._Bvec == _Right._Bvec;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) {
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
@ -5297,13 +5297,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const piecewise_constant_distribution& _Left, const piecewise_constant_distribution& _Right) {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const piecewise_constant_distribution& _Left, const piecewise_constant_distribution& _Right) {
return !(_Left == _Right);
}
@ -5410,13 +5410,13 @@ public:
_Init();
}
_NODISCARD_FRIEND bool operator==(const param_type& _Left, const param_type& _Right) {
_NODISCARD friend bool operator==(const param_type& _Left, const param_type& _Right) {
return static_cast<const _Mypbase&>(_Left) == static_cast<const _Mypbase&>(_Right)
&& _Left._Bvec == _Right._Bvec;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const param_type& _Left, const param_type& _Right) {
_NODISCARD friend bool operator!=(const param_type& _Left, const param_type& _Right) {
return !(_Left == _Right);
}
#endif // !_HAS_CXX20
@ -5521,13 +5521,13 @@ public:
return _Eval(_Eng, _Par0);
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const piecewise_linear_distribution& _Left, const piecewise_linear_distribution& _Right) {
return _Left.param() == _Right.param();
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const piecewise_linear_distribution& _Left, const piecewise_linear_distribution& _Right) {
return !(_Left == _Right);
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -110,7 +110,7 @@ struct _Span_iterator {
return _Tmp;
}
_NODISCARD_FRIEND constexpr _Span_iterator operator+(const difference_type _Off, _Span_iterator _Next) noexcept {
_NODISCARD friend constexpr _Span_iterator operator+(const difference_type _Off, _Span_iterator _Next) noexcept {
_Next += _Off;
return _Next;
}

Просмотреть файл

@ -107,9 +107,9 @@ public:
return __std_stacktrace_source_line(_Address);
}
_NODISCARD_FRIEND constexpr bool operator==(const stacktrace_entry&, const stacktrace_entry&) noexcept = default;
_NODISCARD friend constexpr bool operator==(const stacktrace_entry&, const stacktrace_entry&) noexcept = default;
_NODISCARD_FRIEND constexpr strong_ordering operator<=>(
_NODISCARD friend constexpr strong_ordering operator<=>(
const stacktrace_entry&, const stacktrace_entry&) noexcept = default;
private:
@ -253,12 +253,12 @@ public:
}
template <class _Al2>
_NODISCARD_FRIEND bool operator==(const basic_stacktrace& _Lhs, const basic_stacktrace<_Al2>& _Rhs) noexcept {
_NODISCARD friend bool operator==(const basic_stacktrace& _Lhs, const basic_stacktrace<_Al2>& _Rhs) noexcept {
return _Lhs._Hash == _Rhs._Hash && _STD equal(_Lhs.begin(), _Lhs.end(), _Rhs.begin(), _Rhs.end());
}
template <class _Al2>
_NODISCARD_FRIEND strong_ordering operator<=>(
_NODISCARD friend strong_ordering operator<=>(
const basic_stacktrace& _Lhs, const basic_stacktrace<_Al2>& _Rhs) noexcept {
const auto _Result = _Lhs._Frames.size() <=> _Rhs._Frames.size();
if (_Result != strong_ordering::equal) {

Просмотреть файл

@ -162,7 +162,7 @@ public:
return _Local != nullptr && _Local->_Stop_possible();
}
_NODISCARD_FRIEND bool operator==(const stop_token& _Lhs, const stop_token& _Rhs) noexcept = default;
_NODISCARD friend bool operator==(const stop_token& _Lhs, const stop_token& _Rhs) noexcept = default;
friend void swap(stop_token& _Lhs, stop_token& _Rhs) noexcept {
_STD swap(_Lhs._State, _Rhs._State);
@ -234,7 +234,7 @@ public:
return _Local && _Local->_Request_stop();
}
_NODISCARD_FRIEND bool operator==(const stop_source& _Lhs, const stop_source& _Rhs) noexcept = default;
_NODISCARD friend bool operator==(const stop_source& _Lhs, const stop_source& _Rhs) noexcept = default;
friend void swap(stop_source& _Lhs, stop_source& _Rhs) noexcept {
_STD swap(_Lhs._State, _Rhs._State);

Просмотреть файл

@ -212,39 +212,39 @@ public:
}
#if _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS
_NODISCARD_FRIEND bool operator==(const error_code& _Left, const error_code& _Right) noexcept {
_NODISCARD friend bool operator==(const error_code& _Left, const error_code& _Right) noexcept {
return _Left.category() == _Right.category() && _Left.value() == _Right.value();
}
_NODISCARD_FRIEND bool operator==(const error_code& _Left, const error_condition& _Right) noexcept {
_NODISCARD friend bool operator==(const error_code& _Left, const error_condition& _Right) noexcept {
return _System_error_equal(_Left, _Right);
}
#if _HAS_CXX20
_NODISCARD_FRIEND strong_ordering operator<=>(const error_code& _Left, const error_code& _Right) noexcept {
_NODISCARD friend strong_ordering operator<=>(const error_code& _Left, const error_code& _Right) noexcept {
if (const auto _Result = _Left.category() <=> _Right.category(); _Result != 0) {
return _Result;
}
return _Left.value() <=> _Right.value();
}
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
_NODISCARD_FRIEND bool operator<(const error_code& _Left, const error_code& _Right) noexcept {
_NODISCARD friend bool operator<(const error_code& _Left, const error_code& _Right) noexcept {
return _Left.category() < _Right.category()
|| (_Left.category() == _Right.category() && _Left.value() < _Right.value());
}
_NODISCARD_FRIEND bool operator==(const error_condition& _Left, const error_code& _Right) noexcept {
_NODISCARD friend bool operator==(const error_condition& _Left, const error_code& _Right) noexcept {
return _System_error_equal(_Right, _Left);
}
_NODISCARD_FRIEND bool operator!=(const error_code& _Left, const error_code& _Right) noexcept {
_NODISCARD friend bool operator!=(const error_code& _Left, const error_code& _Right) noexcept {
return !(_Left == _Right);
}
_NODISCARD_FRIEND bool operator!=(const error_code& _Left, const error_condition& _Right) noexcept {
_NODISCARD friend bool operator!=(const error_code& _Left, const error_condition& _Right) noexcept {
return !_System_error_equal(_Left, _Right);
}
_NODISCARD_FRIEND bool operator!=(const error_condition& _Left, const error_code& _Right) noexcept {
_NODISCARD friend bool operator!=(const error_condition& _Left, const error_code& _Right) noexcept {
return !_System_error_equal(_Right, _Left);
}
#endif // ^^^ !_HAS_CXX20 ^^^
@ -301,12 +301,12 @@ public:
}
#if _STL_OPTIMIZE_SYSTEM_ERROR_OPERATORS
_NODISCARD_FRIEND bool operator==(const error_condition& _Left, const error_condition& _Right) noexcept {
_NODISCARD friend bool operator==(const error_condition& _Left, const error_condition& _Right) noexcept {
return _Left.category() == _Right.category() && _Left.value() == _Right.value();
}
#if _HAS_CXX20
_NODISCARD_FRIEND strong_ordering operator<=>(
_NODISCARD friend strong_ordering operator<=>(
const error_condition& _Left, const error_condition& _Right) noexcept {
if (const auto _Result = _Left.category() <=> _Right.category(); _Result != 0) {
return _Result;
@ -314,11 +314,11 @@ public:
return _Left.value() <=> _Right.value();
}
#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv
_NODISCARD_FRIEND bool operator<(const error_condition& _Left, const error_condition& _Right) noexcept {
_NODISCARD friend bool operator<(const error_condition& _Left, const error_condition& _Right) noexcept {
return _Left.category() < _Right.category()
|| (_Left.category() == _Right.category() && _Left.value() < _Right.value());
}
_NODISCARD_FRIEND bool operator!=(const error_condition& _Left, const error_condition& _Right) noexcept {
_NODISCARD friend bool operator!=(const error_condition& _Left, const error_condition& _Right) noexcept {
return !(_Left == _Right);
}
#endif // ^^^ !_HAS_CXX20 ^^^

Просмотреть файл

@ -278,14 +278,14 @@ public:
#if _HAS_CXX23
template <_Tuple_like_non_tuple _Other>
_NODISCARD_FRIEND constexpr bool operator==(const tuple&, const _Other&) noexcept /* strengthened */ {
_NODISCARD friend constexpr bool operator==(const tuple&, const _Other&) noexcept /* strengthened */ {
static_assert(tuple_size_v<_Other> == 0, "Cannot compare tuples of different sizes (N4950 [tuple.rel]/2).");
return true;
}
template <_Tuple_like_non_tuple _Other>
requires (tuple_size_v<remove_cvref_t<_Other>> == 0)
_NODISCARD_FRIEND constexpr strong_ordering operator<=>(const tuple&, const _Other&) noexcept /* strengthened */ {
_NODISCARD friend constexpr strong_ordering operator<=>(const tuple&, const _Other&) noexcept /* strengthened */ {
return strong_ordering::equal;
}
#endif // _HAS_CXX23
@ -771,7 +771,7 @@ public:
}
template <_Tuple_like_non_tuple _Other>
_NODISCARD_FRIEND constexpr bool operator==(const tuple& _Left, const _Other& _Right) {
_NODISCARD friend constexpr bool operator==(const tuple& _Left, const _Other& _Right) {
static_assert(1 + sizeof...(_Rest) == tuple_size_v<_Other>,
"Cannot compare tuples of different sizes (N4950 [tuple.rel]/2).");
static_assert(_Can_equal_compare_with_tuple_like_v<_Other>,
@ -789,7 +789,7 @@ public:
}
template <_Tuple_like_non_tuple _Other>
_NODISCARD_FRIEND constexpr auto operator<=>(const tuple& _Left, const _Other& _Right)
_NODISCARD friend constexpr auto operator<=>(const tuple& _Left, const _Other& _Right)
-> _Three_way_comparison_result_with_tuple_like_t<tuple, _Other> {
return _Left._Three_way_compare_with_tuple_like(_Right, make_index_sequence<1 + sizeof...(_Rest)>{});
}

Просмотреть файл

@ -1439,7 +1439,7 @@ public:
}
#if _HAS_CXX20
_NODISCARD_FRIEND bool operator==(const slice& _Left, const slice& _Right) noexcept /* strengthened */ {
_NODISCARD friend bool operator==(const slice& _Left, const slice& _Right) noexcept /* strengthened */ {
return _Left.start() == _Right.start() && _Left.size() == _Right.size() && _Left.stride() == _Right.stride();
}
#endif // _HAS_CXX20

Просмотреть файл

@ -136,7 +136,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _CONSTEXPR20 _Vector_const_iterator operator+(
_NODISCARD friend _CONSTEXPR20 _Vector_const_iterator operator+(
const difference_type _Off, _Vector_const_iterator _Next) noexcept {
_Next += _Off;
return _Next;
@ -316,7 +316,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _CONSTEXPR20 _Vector_iterator operator+(
_NODISCARD friend _CONSTEXPR20 _Vector_iterator operator+(
const difference_type _Off, _Vector_iterator _Next) noexcept {
_Next += _Off;
return _Next;
@ -2568,7 +2568,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _CONSTEXPR20 _Vb_const_iterator operator+(
_NODISCARD friend _CONSTEXPR20 _Vb_const_iterator operator+(
const difference_type _Off, _Vb_const_iterator _Right) noexcept {
_Right += _Off;
return _Right;
@ -2741,7 +2741,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _CONSTEXPR20 _Vb_iterator operator+(const difference_type _Off, _Vb_iterator _Right) noexcept {
_NODISCARD friend _CONSTEXPR20 _Vb_iterator operator+(const difference_type _Off, _Vb_iterator _Right) noexcept {
_Right += _Off;
return _Right;
}

Просмотреть файл

@ -37,7 +37,7 @@ _EXPORT_STD struct to_chars_result {
char* ptr;
errc ec;
#if _HAS_CXX20
_NODISCARD_FRIEND bool operator==(const to_chars_result&, const to_chars_result&) = default;
_NODISCARD friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
#endif // _HAS_CXX20
};

Просмотреть файл

@ -199,12 +199,12 @@ struct _Reinterpret_move_iter {
// post ++ intentionally omitted
_NODISCARD_FRIEND bool operator==(const _Reinterpret_move_iter& _Lhs, const _Reinterpret_move_iter& _Rhs) {
_NODISCARD friend bool operator==(const _Reinterpret_move_iter& _Lhs, const _Reinterpret_move_iter& _Rhs) {
return _Lhs._Base == _Rhs._Base;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(const _Reinterpret_move_iter& _Lhs, const _Reinterpret_move_iter& _Rhs) {
_NODISCARD friend bool operator!=(const _Reinterpret_move_iter& _Lhs, const _Reinterpret_move_iter& _Rhs) {
return _Lhs._Base != _Rhs._Base;
}
#endif // !_HAS_CXX20

Просмотреть файл

@ -310,13 +310,13 @@ namespace pmr {
return _Resource;
}
_NODISCARD_FRIEND bool operator==(
_NODISCARD friend bool operator==(
const polymorphic_allocator& _Lhs, const polymorphic_allocator& _Rhs) noexcept {
return *_Lhs._Resource == *_Rhs._Resource;
}
#if !_HAS_CXX20
_NODISCARD_FRIEND bool operator!=(
_NODISCARD friend bool operator!=(
const polymorphic_allocator& _Lhs, const polymorphic_allocator& _Rhs) noexcept {
return *_Lhs._Resource != *_Rhs._Resource;
}

Просмотреть файл

@ -141,7 +141,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _CONSTEXPR20 _String_const_iterator operator+(
_NODISCARD friend _CONSTEXPR20 _String_const_iterator operator+(
const difference_type _Off, _String_const_iterator _Next) noexcept {
_Next += _Off;
return _Next;
@ -318,7 +318,7 @@ public:
return _Tmp;
}
_NODISCARD_FRIEND _CONSTEXPR20 _String_iterator operator+(
_NODISCARD friend _CONSTEXPR20 _String_iterator operator+(
const difference_type _Off, _String_iterator _Next) noexcept {
_Next += _Off;
return _Next;

Просмотреть файл

@ -1783,7 +1783,7 @@ public:
}
#if _HAS_CXX20
_NODISCARD_FRIEND constexpr iter_rvalue_reference_t<_BidIt> iter_move(const reverse_iterator& _It) noexcept(
_NODISCARD friend constexpr iter_rvalue_reference_t<_BidIt> iter_move(const reverse_iterator& _It) noexcept(
is_nothrow_copy_constructible_v<_BidIt> //
&& noexcept(_RANGES iter_move(--_STD declval<_BidIt&>()))) {
auto _Tmp = _It.current;
@ -2386,47 +2386,47 @@ public:
template <_Not_a_const_iterator _Other>
requires random_access_iterator<_Iter> && totally_ordered_with<_Iter, _Other>
_NODISCARD_FRIEND constexpr bool operator<(const _Other& _Left, const basic_const_iterator& _Right) noexcept(
_NODISCARD friend constexpr bool operator<(const _Other& _Left, const basic_const_iterator& _Right) noexcept(
noexcept(_STD _Fake_copy_init<bool>(_Left < _Right._Current))) /* strengthened */ {
return _Left < _Right._Current;
}
template <_Not_a_const_iterator _Other>
requires random_access_iterator<_Iter> && totally_ordered_with<_Iter, _Other>
_NODISCARD_FRIEND constexpr bool operator>(const _Other& _Left, const basic_const_iterator& _Right) noexcept(
_NODISCARD friend constexpr bool operator>(const _Other& _Left, const basic_const_iterator& _Right) noexcept(
noexcept(_STD _Fake_copy_init<bool>(_Left > _Right._Current))) /* strengthened */ {
return _Left > _Right._Current;
}
template <_Not_a_const_iterator _Other>
requires random_access_iterator<_Iter> && totally_ordered_with<_Iter, _Other>
_NODISCARD_FRIEND constexpr bool operator<=(const _Other& _Left, const basic_const_iterator& _Right) noexcept(
_NODISCARD friend constexpr bool operator<=(const _Other& _Left, const basic_const_iterator& _Right) noexcept(
noexcept(_STD _Fake_copy_init<bool>(_Left <= _Right._Current))) /* strengthened */ {
return _Left <= _Right._Current;
}
template <_Not_a_const_iterator _Other>
requires random_access_iterator<_Iter> && totally_ordered_with<_Iter, _Other>
_NODISCARD_FRIEND constexpr bool operator>=(const _Other& _Left, const basic_const_iterator& _Right) noexcept(
_NODISCARD friend constexpr bool operator>=(const _Other& _Left, const basic_const_iterator& _Right) noexcept(
noexcept(_STD _Fake_copy_init<bool>(_Left >= _Right._Current))) /* strengthened */ {
return _Left >= _Right._Current;
}
_NODISCARD_FRIEND constexpr basic_const_iterator operator+(const basic_const_iterator& _It,
_NODISCARD friend constexpr basic_const_iterator operator+(const basic_const_iterator& _It,
const difference_type _Off) noexcept(noexcept(basic_const_iterator{_It._Current + _Off})) // strengthened
requires random_access_iterator<_Iter>
{
return basic_const_iterator{_It._Current + _Off};
}
_NODISCARD_FRIEND constexpr basic_const_iterator operator+(const difference_type _Off,
_NODISCARD friend constexpr basic_const_iterator operator+(const difference_type _Off,
const basic_const_iterator& _It) noexcept(noexcept(basic_const_iterator{_It._Current + _Off})) // strengthened
requires random_access_iterator<_Iter>
{
return basic_const_iterator{_It._Current + _Off};
}
_NODISCARD_FRIEND constexpr basic_const_iterator operator-(const basic_const_iterator& _It,
_NODISCARD friend constexpr basic_const_iterator operator-(const basic_const_iterator& _It,
const difference_type _Off) noexcept(noexcept(basic_const_iterator{_It._Current - _Off})) // strengthened
requires random_access_iterator<_Iter>
{
@ -2441,12 +2441,12 @@ public:
template <_Not_a_const_iterator _Sent>
requires sized_sentinel_for<_Sent, _Iter>
_NODISCARD_FRIEND constexpr difference_type operator-(const _Sent& _Se, const basic_const_iterator& _It) noexcept(
_NODISCARD friend constexpr difference_type operator-(const _Sent& _Se, const basic_const_iterator& _It) noexcept(
noexcept(_Se - _It._Current)) /* strengthened */ {
return _Se - _It._Current;
}
_NODISCARD_FRIEND constexpr _Rvalue_reference iter_move(const basic_const_iterator& _It) noexcept(
_NODISCARD friend constexpr _Rvalue_reference iter_move(const basic_const_iterator& _It) noexcept(
noexcept(static_cast<_Rvalue_reference>(_RANGES iter_move(_It._Current)))) {
return static_cast<_Rvalue_reference>(_RANGES iter_move(_It._Current));
}
@ -4313,25 +4313,25 @@ public:
#if _HAS_CXX20
template <sentinel_for<_Iter> _Sent>
_NODISCARD_FRIEND constexpr bool
_NODISCARD friend constexpr bool
operator==(const move_iterator& _Left, const move_sentinel<_Sent>& _Right) noexcept(
noexcept(_STD _Fake_copy_init<bool>(_Left._Current == _Right._Get_last()))) /* strengthened */ {
return _Left._Current == _Right._Get_last();
}
template <sized_sentinel_for<_Iter> _Sent>
_NODISCARD_FRIEND constexpr difference_type operator-(const move_sentinel<_Sent>& _Left,
_NODISCARD friend constexpr difference_type operator-(const move_sentinel<_Sent>& _Left,
const move_iterator& _Right) noexcept(noexcept(_Left._Get_last() - _Right._Current)) /* strengthened */ {
return _Left._Get_last() - _Right._Current;
}
template <sized_sentinel_for<_Iter> _Sent>
_NODISCARD_FRIEND constexpr difference_type operator-(const move_iterator& _Left,
_NODISCARD friend constexpr difference_type operator-(const move_iterator& _Left,
const move_sentinel<_Sent>& _Right) noexcept(noexcept(_Left._Current - _Right._Get_last())) /* strengthened */ {
return _Left._Current - _Right._Get_last();
}
_NODISCARD_FRIEND constexpr reference iter_move(const move_iterator& _It) noexcept(
_NODISCARD friend constexpr reference iter_move(const move_iterator& _It) noexcept(
noexcept(_RANGES iter_move(_It._Current))) {
return _RANGES iter_move(_It._Current);
}
@ -4500,7 +4500,7 @@ _EXPORT_STD struct unreachable_sentinel_t;
namespace _Unreachable_sentinel_detail {
struct _Base {
template <weakly_incrementable _Winc>
_NODISCARD_FRIEND constexpr bool operator==(const unreachable_sentinel_t&, const _Winc&) noexcept {
_NODISCARD friend constexpr bool operator==(const unreachable_sentinel_t&, const _Winc&) noexcept {
return false;
}
};

Просмотреть файл

@ -592,12 +592,6 @@
#define _NODISCARD_CTOR_MSG(_Msg)
#endif // ^^^ defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard) < 201907L ^^^
#if defined(__CUDACC__) && !defined(__clang__) // TRANSITION, VSO-568006
#define _NODISCARD_FRIEND friend
#else // ^^^ workaround / no workaround vvv
#define _NODISCARD_FRIEND _NODISCARD friend
#endif // ^^^ no workaround ^^^
#define _NODISCARD_REMOVE_ALG \
_NODISCARD_MSG("The 'remove' and 'remove_if' algorithms return the iterator past the last element " \
"that should be kept. You need to call container.erase(result, container.end()) afterwards. " \