[libcxx] r225429 - Add checks to make sure the hash functor has the right typedefs

Marshall Clow mclow.lists at gmail.com
Wed Jan 7 22:19:00 PST 2015


Author: marshall
Date: Thu Jan  8 00:18:59 2015
New Revision: 225429

URL: http://llvm.org/viewvc/llvm-project?rev=225429&view=rev
Log:
Add checks to make sure the hash functor has the right typedefs

Modified:
    libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp

Modified: libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp?rev=225429&r1=225428&r2=225429&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/type.index/type.index.hash/hash.pass.cpp Thu Jan  8 00:18:59 2015
@@ -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());
 }





More information about the cfe-commits mailing list