diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-09-07 10:21:51 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-09-07 10:21:51 -0400 |
commit | cdcc27c1ca9c485c66ac1914e352c79e5048b6b5 (patch) | |
tree | 2217dade44d2ee945fba13ab9be1887f8854b151 /libstdc++-v3 | |
parent | 66af6e991bf0daf1c41e46400a8f19e87c358cf2 (diff) | |
download | gcc-cdcc27c1ca9c485c66ac1914e352c79e5048b6b5.zip gcc-cdcc27c1ca9c485c66ac1914e352c79e5048b6b5.tar.gz gcc-cdcc27c1ca9c485c66ac1914e352c79e5048b6b5.tar.bz2 |
libstdc++: Optimize is_reference
Instead of defining is_reference in terms of is_[lr]value_reference,
just define it directly.
libstdc++-v3/ChangeLog:
* include/std/type_traits (is_reference): Make the primary
template derive from false_type. Define two partial
specializations that derive from true_type.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/include/std/type_traits | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index b83e725..94e73ea 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -611,8 +611,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// is_reference template<typename _Tp> struct is_reference - : public __or_<is_lvalue_reference<_Tp>, - is_rvalue_reference<_Tp>>::type + : public false_type + { }; + + template<typename _Tp> + struct is_reference<_Tp&> + : public true_type + { }; + + template<typename _Tp> + struct is_reference<_Tp&&> + : public true_type { }; /// is_arithmetic |