Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stl/inc/expected
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public:
// [expected.un.eq]
template <class _UErr>
_NODISCARD_FRIEND constexpr bool operator==(const unexpected& _Left, const unexpected<_UErr>& _Right) noexcept( //
noexcept(_Implicitly_convert_to<bool>(_Left._Unexpected == _Right.error()))) { // strengthened
noexcept(_Fake_copy_init<bool>(_Left._Unexpected == _Right.error()))) { // strengthened
return _Left._Unexpected == _Right.error();
}

Expand Down Expand Up @@ -702,8 +702,8 @@ public:
template <class _Uty, class _UErr>
requires (!is_void_v<_Uty>)
_NODISCARD_FRIEND constexpr bool operator==(const expected& _Left, const expected<_Uty, _UErr>& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Value == *_Right)) && noexcept(
_Implicitly_convert_to<bool>(_Left._Unexpected == _Right.error()))) { // strengthened
noexcept(_Fake_copy_init<bool>(_Left._Value == *_Right)) && noexcept(
_Fake_copy_init<bool>(_Left._Unexpected == _Right.error()))) { // strengthened
// clang-format on
if (_Left._Has_value != _Right.has_value()) {
return false;
Expand Down
54 changes: 27 additions & 27 deletions stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,7 @@ namespace ranges {
}

_NODISCARD constexpr bool _Equal(const sentinel_t<_Vw>& _Last) const
noexcept(noexcept(_Implicitly_convert_to<bool>(_Current == _Last))) {
noexcept(noexcept(_Fake_copy_init<bool>(_Current == _Last))) {
return _Current == _Last;
}
};
Expand Down Expand Up @@ -3396,7 +3396,7 @@ namespace ranges {

// clang-format off
_NODISCARD_FRIEND constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Outer == _Right._Outer
noexcept(_Fake_copy_init<bool>(_Left._Outer == _Right._Outer
&& _Left._Inner == _Right._Inner))) /* strengthened */
requires _Deref_is_glvalue && equality_comparable<_OuterIter> && equality_comparable<_InnerIter> {
// clang-format on
Expand Down Expand Up @@ -3447,7 +3447,7 @@ namespace ranges {
template <bool _OtherConst>
requires sentinel_for<sentinel_t<_Base>, _Maybe_const_iter<_OtherConst>>
_NODISCARD constexpr bool _Equal(const _Iterator<_OtherConst>& _It) const noexcept(
noexcept(_Implicitly_convert_to<bool>(_It._Outer == _Last))) {
noexcept(_Fake_copy_init<bool>(_It._Outer == _Last))) {
// clang-format on
return _It._Outer == _Last;
}
Expand Down Expand Up @@ -3905,7 +3905,7 @@ namespace ranges {

template <bool _OtherConst>
_NODISCARD constexpr bool _Equal(const _Iterator<_OtherConst>& _It) const
noexcept(noexcept(_Implicitly_convert_to<bool>(_It._Outer_it == _Last))) {
noexcept(noexcept(_Fake_copy_init<bool>(_It._Outer_it == _Last))) {
_STL_INTERNAL_STATIC_ASSERT(
sentinel_for<sentinel_t<_Base>, iterator_t<_Maybe_const<_OtherConst, _Vw>>>);
return _It._Outer_it == _Last;
Expand Down Expand Up @@ -4113,7 +4113,7 @@ namespace ranges {
}

_NODISCARD constexpr bool _At_end() const
noexcept(noexcept(_Implicitly_convert_to<bool>(_Get_current() == _RANGES end(_Parent->_Range)))) {
noexcept(noexcept(_Fake_copy_init<bool>(_Get_current() == _RANGES end(_Parent->_Range)))) {
return _Get_current() == _RANGES end(_Parent->_Range);
}

Expand Down Expand Up @@ -4534,7 +4534,7 @@ namespace ranges {
/* [[no_unique_address]] */ sentinel_t<_Vw> _Last{};

_NODISCARD constexpr bool _Equal(const _Iterator& _It) const
noexcept(noexcept(_Implicitly_convert_to<bool>(_It._Current == _Last))) {
noexcept(noexcept(_Fake_copy_init<bool>(_It._Current == _Last))) {
return !_It._Trailing_empty && _It._Current == _Last;
}

Expand Down Expand Up @@ -5727,35 +5727,35 @@ namespace ranges {
}

_NODISCARD_FRIEND constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Current == _Right._Current))) /* strengthened */ {
noexcept(_Fake_copy_init<bool>(_Left._Current == _Right._Current))) /* strengthened */ {
return _Left._Current == _Right._Current;
}

_NODISCARD_FRIEND constexpr bool operator==(const _Iterator& _Left, default_sentinel_t) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Current == _Left._End))) /* strengthened */ {
noexcept(_Fake_copy_init<bool>(_Left._Current == _Left._End))) /* strengthened */ {
return _Left._Current == _Left._End;
}

_NODISCARD_FRIEND constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Current < _Right._Current))) /* strengthened */
noexcept(_Fake_copy_init<bool>(_Left._Current < _Right._Current))) /* strengthened */
requires random_access_range<_Base> {
return _Left._Current < _Right._Current;
}

_NODISCARD_FRIEND constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Right._Current < _Left._Current))) /* strengthened */
noexcept(_Fake_copy_init<bool>(_Right._Current < _Left._Current))) /* strengthened */
requires random_access_range<_Base> {
return _Right._Current < _Left._Current;
}

_NODISCARD_FRIEND constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(!(_Right._Current < _Left._Current)))) /* strengthened */
noexcept(_Fake_copy_init<bool>(!(_Right._Current < _Left._Current)))) /* strengthened */
requires random_access_range<_Base> {
return !(_Right._Current < _Left._Current);
}

_NODISCARD_FRIEND constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(!(_Left._Current < _Right._Current)))) /* strengthened */
noexcept(_Fake_copy_init<bool>(!(_Left._Current < _Right._Current)))) /* strengthened */
requires random_access_range<_Base> {
return !(_Left._Current < _Right._Current);
}
Expand Down Expand Up @@ -6065,7 +6065,7 @@ namespace ranges {
}

_NODISCARD_FRIEND constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Current == _Right._Current))) /* strengthened */ {
noexcept(_Fake_copy_init<bool>(_Left._Current == _Right._Current))) /* strengthened */ {
if constexpr (_Slide_caches_first<_Base>) {
return _Left._Last_element == _Right._Last_element;
} else {
Expand All @@ -6074,25 +6074,25 @@ namespace ranges {
}

_NODISCARD_FRIEND constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Current < _Right._Current))) /* strengthened */
noexcept(_Fake_copy_init<bool>(_Left._Current < _Right._Current))) /* strengthened */
requires random_access_range<_Base> {
return _Left._Current < _Right._Current;
}

_NODISCARD_FRIEND constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Right._Current < _Left._Current))) /* strengthened */
noexcept(_Fake_copy_init<bool>(_Right._Current < _Left._Current))) /* strengthened */
requires random_access_range<_Base> {
return _Right._Current < _Left._Current;
}

_NODISCARD_FRIEND constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(!(_Right._Current < _Left._Current)))) /* strengthened */
noexcept(_Fake_copy_init<bool>(!(_Right._Current < _Left._Current)))) /* strengthened */
requires random_access_range<_Base> {
return !(_Right._Current < _Left._Current);
}

_NODISCARD_FRIEND constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(!(_Left._Current < _Right._Current)))) /* strengthened */
noexcept(_Fake_copy_init<bool>(!(_Left._Current < _Right._Current)))) /* strengthened */
requires random_access_range<_Base> {
return !(_Left._Current < _Right._Current);
}
Expand Down Expand Up @@ -6151,8 +6151,8 @@ namespace ranges {
_Sentinel() = default;

_NODISCARD_FRIEND constexpr bool
operator==(const _Iterator<false>& _Left, const _Sentinel& _Right) noexcept(noexcept(
_Implicitly_convert_to<bool>(_Left._Get_last_element() == _Right._Last))) /* strengthened */ {
operator==(const _Iterator<false>& _Left, const _Sentinel& _Right) noexcept(
noexcept(_Fake_copy_init<bool>(_Left._Get_last_element() == _Right._Last))) /* strengthened */ {
return _Left._Get_last_element() == _Right._Last;
}

Expand Down Expand Up @@ -6375,12 +6375,12 @@ namespace ranges {
}

_NODISCARD_FRIEND constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Current == _Right._Current))) /* strengthened */ {
noexcept(_Fake_copy_init<bool>(_Left._Current == _Right._Current))) /* strengthened */ {
return _Left._Current == _Right._Current;
}

_NODISCARD_FRIEND constexpr bool operator==(const _Iterator& _Left, default_sentinel_t) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Current == _Left._Next))) /* strengthened */ {
noexcept(_Fake_copy_init<bool>(_Left._Current == _Left._Next))) /* strengthened */ {
return _Left._Current == _Left._Next;
}
};
Expand Down Expand Up @@ -6630,36 +6630,36 @@ namespace ranges {
}

_NODISCARD_FRIEND constexpr bool operator==(const _Iterator& _It, default_sentinel_t) noexcept(
noexcept(_Implicitly_convert_to<bool>(_It._Current == _It._End))) /* strengthened */ {
noexcept(_Fake_copy_init<bool>(_It._Current == _It._End))) /* strengthened */ {
return _It._Current == _It._End;
}

_NODISCARD_FRIEND constexpr bool operator==(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Current == _Right._Current))) // strengthened
noexcept(_Fake_copy_init<bool>(_Left._Current == _Right._Current))) // strengthened
requires equality_comparable<_Base_iterator> {
return _Left._Current == _Right._Current;
}

_NODISCARD_FRIEND constexpr bool operator<(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Left._Current < _Right._Current))) // strengthened
noexcept(_Fake_copy_init<bool>(_Left._Current < _Right._Current))) // strengthened
requires random_access_range<_Base> {
return _Left._Current < _Right._Current;
}

_NODISCARD_FRIEND constexpr bool operator>(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(_Right._Current < _Left._Current))) // strengthened
noexcept(_Fake_copy_init<bool>(_Right._Current < _Left._Current))) // strengthened
requires random_access_range<_Base> {
return _Right._Current < _Left._Current;
}

_NODISCARD_FRIEND constexpr bool operator<=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(!(_Right._Current < _Left._Current)))) // strengthened
noexcept(_Fake_copy_init<bool>(!(_Right._Current < _Left._Current)))) // strengthened
requires random_access_range<_Base> {
return !(_Right._Current < _Left._Current);
}

_NODISCARD_FRIEND constexpr bool operator>=(const _Iterator& _Left, const _Iterator& _Right) noexcept(
noexcept(_Implicitly_convert_to<bool>(!(_Left._Current < _Right._Current)))) // strengthened
noexcept(_Fake_copy_init<bool>(!(_Left._Current < _Right._Current)))) // strengthened
requires random_access_range<_Base> {
return !(_Left._Current < _Right._Current);
}
Expand Down
23 changes: 4 additions & 19 deletions stl/inc/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -1590,24 +1590,9 @@ _CONSTEXPR17 auto invoke(_Callable&& _Obj, _Ty1&& _Arg1, _Types2&&... _Args2) no
#pragma warning(disable : 4242) // '%s': conversion from '%s' to '%s', possible loss of data (/Wall)
#pragma warning(disable : 4244) // '%s': conversion from '%s' to '%s', possible loss of data (Yes, duplicated message.)
#pragma warning(disable : 4365) // '%s': conversion from '%s' to '%s', signed/unsigned mismatch (/Wall)
#pragma warning(disable : 5215) // '%s' a function parameter with a volatile qualified type is deprecated in C++20

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-volatile"
#endif // __clang__

// Note that this is equivalent to xstddef's _Fake_copy_init (and _Fake_decay_copy).
// TRANSITION, replace _Implicitly_convert_to with _Fake_copy_init.
template <class _To>
void _Implicitly_convert_to(_To) noexcept; // not defined

template <class _From, class _To, bool = is_convertible_v<_From, _To>, bool = is_void_v<_To>>
_INLINE_VAR constexpr bool _Is_nothrow_convertible_v = noexcept(_Implicitly_convert_to<_To>(_STD declval<_From>()));

#ifdef __clang__
#pragma clang diagnostic pop
#endif // __clang__
_INLINE_VAR constexpr bool _Is_nothrow_convertible_v = noexcept(_Fake_copy_init<_To>(_STD declval<_From>()));

#pragma warning(pop)

Expand All @@ -1634,11 +1619,11 @@ template <class _From, class _To, class = void>
struct _Invoke_convertible : false_type {};

template <class _From, class _To>
struct _Invoke_convertible<_From, _To, void_t<decltype(_Implicitly_convert_to<_To>(_Returns_exactly<_From>()))>>
: true_type {};
struct _Invoke_convertible<_From, _To, void_t<decltype(_Fake_copy_init<_To>(_Returns_exactly<_From>()))>> : true_type {
};

template <class _From, class _To>
struct _Invoke_nothrow_convertible : bool_constant<noexcept(_Implicitly_convert_to<_To>(_Returns_exactly<_From>()))> {};
struct _Invoke_nothrow_convertible : bool_constant<noexcept(_Fake_copy_init<_To>(_Returns_exactly<_From>()))> {};

template <class _Result, bool _Nothrow>
struct _Invoke_traits_common {
Expand Down
4 changes: 1 addition & 3 deletions stl/inc/xstddef
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ struct binary_function { // base class for binary functions
#endif // _HAS_AUTO_PTR_ETC

#pragma warning(push)
#pragma warning(disable : 4242) // '%s': conversion from '%s' to '%s', possible loss of data (/Wall)
#pragma warning(disable : 4244) // '%s': conversion from '%s' to '%s', possible loss of data (Yes, duplicated message.)
#pragma warning(disable : 4365) // '%s': conversion from '%s' to '%s', signed/unsigned mismatch (/Wall)
#pragma warning(disable : 5215) // '%s' a function parameter with a volatile qualified type is deprecated in C++20
#pragma warning(disable : 5216) // '%s' a volatile qualified return type is deprecated in C++20

#ifdef __clang__
#pragma clang diagnostic push
Expand Down
Loading