aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/bits/cpp_type_traits.h
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2003-05-11 09:07:17 +0000
committerGabriel Dos Reis <gdr@integrable-solutions.net>2003-05-11 09:07:17 +0000
commit438c6f457273b4cadc1cd459fd4c119ad8a3653c (patch)
tree461d69e0788dca2c949e2cf6b54556cd5cdfdace /libstdc++-v3/include/bits/cpp_type_traits.h
parent9d69b5ed151c268ea3df58f5546453e9eb8dfdb4 (diff)
PR libstdc++/3181
* include/c_std/std_cmath.h: #include <bits/cpp_type_traits.h> (acos): Handle integer argument. (asin): Likewise. (atan): Likewise. (atan2): Likewise. (ceil): Likewise. (cos): Likewise. (cosh): Likewise. (exp): Likewise. (fabs): Likewise. (floor): Likewise. (frexp): Likewise. (ldexp): Likewise. (log): Likewise. (log10): Likewise. (sin): Likewise. (sinh): Likewise. (sqrt): Likewise. (tan): Likewise. (tanh): Likewise. * include/bits/cpp_type_traits.h (__are_same<>): New traits. (__enable_if): Likewise. * testsuite/26_numerics/cmath/overloads.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@66681 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/cpp_type_traits.h')
-rw-r--r--libstdc++-v3/include/bits/cpp_type_traits.h34
1 files changed, 33 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/cpp_type_traits.h b/libstdc++-v3/include/bits/cpp_type_traits.h
index d66fe763841..415150275c4 100644
--- a/libstdc++-v3/include/bits/cpp_type_traits.h
+++ b/libstdc++-v3/include/bits/cpp_type_traits.h
@@ -1,6 +1,6 @@
// The -*- C++ -*- type traits classes for internal use in libstdc++
-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -66,6 +66,38 @@
namespace std
{
+ // Compare for equality of types.
+ template<typename, typename>
+ struct __are_same
+ {
+ enum
+ {
+ _M_type = 0
+ };
+ };
+
+ template<typename _Tp>
+ struct __are_same<_Tp, _Tp>
+ {
+ enum
+ {
+ _M_type = 1
+ };
+ };
+
+ // Define a nested type if some predicate holds.
+ template<typename, bool>
+ struct __enable_if
+ {
+ };
+
+ template<typename _Tp>
+ struct __enable_if<_Tp, true>
+ {
+ typedef _Tp _M_type;
+ };
+
+ // Holds if the template-argument is a void type.
template<typename _Tp>
struct __is_void
{