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.
This commit is contained in:
parent
66af6e991b
commit
cdcc27c1ca
1 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue