aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Matsui <kmatsui@gcc.gnu.org>2023-09-11 13:58:35 -0700
committerKen Matsui <kmatsui@gcc.gnu.org>2024-06-13 05:55:57 -0700
commitb38aefbbc90a3334c6c5ba6569816d348a1a0c91 (patch)
treec7cc39c88787b831933e6d48b5a8fee830570864
parentbb99672e0c49d8b8822664eaabc10cd51a42aab4 (diff)
downloadgcc-b38aefbbc90a3334c6c5ba6569816d348a1a0c91.zip
gcc-b38aefbbc90a3334c6c5ba6569816d348a1a0c91.tar.gz
gcc-b38aefbbc90a3334c6c5ba6569816d348a1a0c91.tar.bz2
libstdc++: Optimize std::is_unbounded_array compilation performance
This patch optimizes the compilation performance of std::is_unbounded_array by dispatching to the new __is_unbounded_array built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_unbounded_array_v): Use __is_unbounded_array built-in trait. Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org> Reviewed-by: Patrick Palka <ppalka@redhat.com> Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
-rw-r--r--libstdc++-v3/include/std/type_traits5
1 files changed, 5 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits
index 748fa18..efbe273d 100644
--- a/libstdc++-v3/include/std/type_traits
+++ b/libstdc++-v3/include/std/type_traits
@@ -3682,11 +3682,16 @@ template<typename _Ret, typename _Fn, typename... _Args>
/// True for a type that is an array of unknown bound.
/// @ingroup variable_templates
/// @since C++20
+# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_unbounded_array)
+ template<typename _Tp>
+ inline constexpr bool is_unbounded_array_v = __is_unbounded_array(_Tp);
+# else
template<typename _Tp>
inline constexpr bool is_unbounded_array_v = false;
template<typename _Tp>
inline constexpr bool is_unbounded_array_v<_Tp[]> = true;
+# endif
/// True for a type that is an array of known bound.
/// @since C++20