This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Optimize add_lvalue_reference/add_rvalue_reference in mainline
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 15 Mar 2009 01:57:47 +0100
- Subject: [v3] Optimize add_lvalue_reference/add_rvalue_reference in mainline
Hi,
tested x86_64-linux, committed to mainline.
Paolo.
////////////////////
2009-03-14 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/type_traits (__add_lvalue_reference_helper,
__add_rvalue_reference_helper): As an optimization, rewrite
condition (avoid is_function).
Index: include/std/type_traits
===================================================================
--- include/std/type_traits (revision 144866)
+++ include/std/type_traits (working copy)
@@ -111,7 +111,7 @@
{ typedef _Tp type; };
template<typename _Tp,
- bool = is_object<_Tp>::value || is_function<_Tp>::value,
+ bool = !is_reference<_Tp>::value && !is_void<_Tp>::value,
bool = is_rvalue_reference<_Tp>::value>
struct __add_lvalue_reference_helper
{ typedef _Tp type; };
@@ -131,7 +131,7 @@
{ };
template<typename _Tp,
- bool = is_object<_Tp>::value || is_function<_Tp>::value>
+ bool = !is_reference<_Tp>::value && !is_void<_Tp>::value>
struct __add_rvalue_reference_helper
{ typedef _Tp type; };