diff options
author | Ken Matsui <kmatsui@gcc.gnu.org> | 2024-02-14 05:50:49 -0800 |
---|---|---|
committer | Ken Matsui <kmatsui@gcc.gnu.org> | 2024-06-13 05:56:18 -0700 |
commit | d5e994f44653b913e24753351e713befffbf1a01 (patch) | |
tree | 7b6ceb2ac5b136d2ea5b3e634c1872b50079e3ef | |
parent | 24da955ab442107909a06f3ef722f4dbf6751236 (diff) | |
download | gcc-d5e994f44653b913e24753351e713befffbf1a01.zip gcc-d5e994f44653b913e24753351e713befffbf1a01.tar.gz gcc-d5e994f44653b913e24753351e713befffbf1a01.tar.bz2 |
libstdc++: Optimize std::remove_extent compilation performance
This patch optimizes the compilation performance of std::remove_extent
by dispatching to the new __remove_extent built-in trait.
libstdc++-v3/ChangeLog:
* include/std/type_traits (remove_extent): Use __remove_extent
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_traits | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index e179015..02d7a3e 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2078,6 +2078,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Array modifications. /// remove_extent +#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_extent) + template<typename _Tp> + struct remove_extent + { using type = __remove_extent(_Tp); }; +#else template<typename _Tp> struct remove_extent { using type = _Tp; }; @@ -2089,6 +2094,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp> struct remove_extent<_Tp[]> { using type = _Tp; }; +#endif /// remove_all_extents template<typename _Tp> |