1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // : public unary_function<T, size_t>
16 // size_t operator()(T val) const;
23 #include <type_traits>
29 typedef std::hash
<T
> H
;
30 static_assert((std::is_base_of
<std::unary_function
<T
, std::size_t>,
33 std::string g1
= "1234567890";
34 std::string g2
= "1234567891";
35 T
s1(g1
.begin(), g1
.end());
36 T
s2(g2
.begin(), g2
.end());
37 assert(h(s1
) != h(s2
));
43 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
44 test
<std::u16string
>();
45 test
<std::u32string
>();
46 #endif // _LIBCPP_HAS_NO_UNICODE_CHARS