Add checks to make sure the hash functor has the right typedefs

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225429 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow 2015-01-08 06:18:59 +00:00
parent c7e395f338
commit 1fdd937c0a

View File

@ -23,6 +23,10 @@
int main()
{
typedef std::hash<std::type_index> H;
static_assert((std::is_same<typename H::argument_type, std::type_index>::value), "" );
static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
std::type_index t1 = typeid(int);
assert(std::hash<std::type_index>()(t1) == t1.hash_code());
}