aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorDouglas Gregor <doug.gregor@gmail.com>2009-10-13 21:17:00 +0000
committerDouglas Gregor <doug.gregor@gmail.com>2009-10-13 21:17:00 +0000
commit07087113c591107ec2b39346a39c160a8e5f1170 (patch)
tree58d932a750c26f059742fc3680f3d55a4ebb2557 /include/llvm
parentdd7bd93b11d18bc0bcb64e8ee5261c5724b25614 (diff)
downloadexternal_llvm-07087113c591107ec2b39346a39c160a8e5f1170.tar.gz
external_llvm-07087113c591107ec2b39346a39c160a8e5f1170.tar.bz2
external_llvm-07087113c591107ec2b39346a39c160a8e5f1170.zip
Add is_same type trait
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Support/type_traits.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Support/type_traits.h b/include/llvm/Support/type_traits.h
index 71f7655e2e..5f799b850d 100644
--- a/include/llvm/Support/type_traits.h
+++ b/include/llvm/Support/type_traits.h
@@ -49,6 +49,17 @@ struct is_class
enum { value = sizeof(char) == sizeof(dont_use::is_class_helper<T>(0)) };
};
+/// \brief Metafunction that determines whether the two given types are
+/// equivalent.
+template<typename T, typename U>
+struct is_same {
+ static const bool value = false;
+};
+
+template<typename T>
+struct is_same<T, T> {
+ static const bool value = true;
+};
// enable_if_c - Enable/disable a template based on a metafunction
template<bool Cond, typename T = void>