Add is_same type trait

llvm-svn: 84029
This commit is contained in:
Douglas Gregor 2009-10-13 21:17:00 +00:00
parent d4a35e9f36
commit 1fd6052176

View File

@ -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>