@@ -242,6 +242,7 @@ namespace std {
242242# include < __type_traits/is_assignable.h>
243243# include < __type_traits/is_constructible.h>
244244# include < __type_traits/is_convertible.h>
245+ # include < __type_traits/is_core_convertible.h>
245246# include < __type_traits/is_destructible.h>
246247# include < __type_traits/is_nothrow_assignable.h>
247248# include < __type_traits/is_nothrow_constructible.h>
@@ -1453,6 +1454,11 @@ struct __convert_to_bool {
14531454};
14541455
14551456template <class ... _Types>
1457+ # if _LIBCPP_STD_VER >= 26
1458+ requires (requires (const _Types& __t ) {
1459+ { __t == __t } -> __core_convertible_to<bool >
1460+ } && ...)
1461+ # endif
14561462_LIBCPP_HIDE_FROM_ABI constexpr bool operator ==(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) {
14571463 using __variant_detail::__visitation::__variant;
14581464 if (__lhs.index () != __rhs.index ())
@@ -1485,6 +1491,11 @@ operator<=>(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) {
14851491# endif // _LIBCPP_STD_VER >= 20
14861492
14871493template <class ... _Types>
1494+ # if _LIBCPP_STD_VER >= 26
1495+ requires (requires (const _Types& __t ) {
1496+ { __t != __t } -> __core_convertible_to<bool >
1497+ } && ...)
1498+ # endif
14881499_LIBCPP_HIDE_FROM_ABI constexpr bool operator !=(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) {
14891500 using __variant_detail::__visitation::__variant;
14901501 if (__lhs.index () != __rhs.index ())
@@ -1495,6 +1506,11 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const variant<_Types...>& __lhs,
14951506}
14961507
14971508template <class ... _Types>
1509+ # if _LIBCPP_STD_VER >= 26
1510+ requires (requires (const _Types& __t ) {
1511+ { __t < __t } -> __core_convertible_to<bool >
1512+ } && ...)
1513+ # endif
14981514_LIBCPP_HIDE_FROM_ABI constexpr bool operator <(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) {
14991515 using __variant_detail::__visitation::__variant;
15001516 if (__rhs.valueless_by_exception ())
@@ -1509,6 +1525,11 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const variant<_Types...>& __lhs,
15091525}
15101526
15111527template <class ... _Types>
1528+ # if _LIBCPP_STD_VER >= 26
1529+ requires (requires (const _Types& __t ) {
1530+ { __t > __t } -> __core_convertible_to<bool >
1531+ } && ...)
1532+ # endif
15121533_LIBCPP_HIDE_FROM_ABI constexpr bool operator >(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) {
15131534 using __variant_detail::__visitation::__variant;
15141535 if (__lhs.valueless_by_exception ())
@@ -1523,6 +1544,11 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const variant<_Types...>& __lhs,
15231544}
15241545
15251546template <class ... _Types>
1547+ # if _LIBCPP_STD_VER >= 26
1548+ requires (requires (const _Types& __t ) {
1549+ { __t <= __t } -> __core_convertible_to<bool >
1550+ } && ...)
1551+ # endif
15261552_LIBCPP_HIDE_FROM_ABI constexpr bool operator <=(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) {
15271553 using __variant_detail::__visitation::__variant;
15281554 if (__lhs.valueless_by_exception ())
@@ -1537,6 +1563,11 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const variant<_Types...>& __lhs,
15371563}
15381564
15391565template <class ... _Types>
1566+ # if _LIBCPP_STD_VER >= 26
1567+ requires (requires (const _Types& __t ) {
1568+ { __t >= __t } -> __core_convertible_to<bool >
1569+ } && ...)
1570+ # endif
15401571_LIBCPP_HIDE_FROM_ABI constexpr bool operator >=(const variant<_Types...>& __lhs, const variant<_Types...>& __rhs) {
15411572 using __variant_detail::__visitation::__variant;
15421573 if (__rhs.valueless_by_exception ())
0 commit comments