This patch optimizes the compilation performance of std::decay
by dispatching to the new __decay built-in trait.
libstdc++-v3/ChangeLog:
* include/std/type_traits (decay): Use __decay 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>
/// @cond undocumented
+#if _GLIBCXX_USE_BUILTIN_TRAIT(__decay)
+ template<typename _Tp>
+ struct decay
+ { using type = __decay(_Tp); };
+#else
// Decay trait for arrays and functions, used for perfect forwarding
// in make_pair, make_tuple, etc.
template<typename _Up>
template<typename _Tp>
struct decay<_Tp&&>
{ using type = typename __decay_selector<_Tp>::type; };
+#endif
/// @cond undocumented