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>
// 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; };
template<typename _Tp>
struct remove_extent<_Tp[]>
{ using type = _Tp; };
+#endif
/// remove_all_extents
template<typename _Tp>