From 2792421f623876b2a69d1c031207053f867dbc25 Mon Sep 17 00:00:00 2001 From: Goodenough <2381642961@qq.com> Date: Mon, 7 Aug 2023 22:21:00 +0800 Subject: [PATCH 1/2] update stl/inc/xtrlcommon: _Is_any_of_v --- stl/inc/xtr1common | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stl/inc/xtr1common b/stl/inc/xtr1common index 18053e59d7..01b0e2efa6 100644 --- a/stl/inc/xtr1common +++ b/stl/inc/xtr1common @@ -168,7 +168,11 @@ _INLINE_VAR constexpr bool disjunction_v = disjunction<_Traits...>::value; template _INLINE_VAR constexpr bool _Is_any_of_v = // true if and only if _Ty is in _Types +#if _HAS_CXX17 + (is_same_v<_Ty, _Types> || ...); +#else disjunction_v...>; +#endif /* _HAS_CXX17 */ _NODISCARD constexpr bool _Is_constant_evaluated() noexcept { // Internal function for any standard mode return __builtin_is_constant_evaluated(); From 41700f15f780896bc0ca80324a961642bfbe5a64 Mon Sep 17 00:00:00 2001 From: Goodenough <2381642961@qq.com> Date: Mon, 7 Aug 2023 22:49:53 +0800 Subject: [PATCH 2/2] update stl/inc/xtrlcommon: _Is_any_of_v --- stl/inc/xtr1common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stl/inc/xtr1common b/stl/inc/xtr1common index 01b0e2efa6..f9b5c8c4cf 100644 --- a/stl/inc/xtr1common +++ b/stl/inc/xtr1common @@ -170,9 +170,9 @@ template _INLINE_VAR constexpr bool _Is_any_of_v = // true if and only if _Ty is in _Types #if _HAS_CXX17 (is_same_v<_Ty, _Types> || ...); -#else +#else // ^^^ _HAS_CXX17 / !_HAS_CXX17 vvv disjunction_v...>; -#endif /* _HAS_CXX17 */ +#endif // _HAS_CXX17 _NODISCARD constexpr bool _Is_constant_evaluated() noexcept { // Internal function for any standard mode return __builtin_is_constant_evaluated();