1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <memory>
11 
12 // template <class T, class D>
13 // struct hash<unique_ptr<T, D>>
14 // {
15 //     typedef unique_ptr<T, D> argument_type;
16 //     typedef size_t           result_type;
17 //     size_t operator()(const unique_ptr<T, D>& p) const;
18 // };
19 
20 #include <memory>
21 #include <cassert>
22 
main()23 int main()
24 {
25     int* ptr = new int;
26     std::unique_ptr<int> p(ptr);
27     std::hash<std::unique_ptr<int> > f;
28     std::size_t h = f(p);
29     assert(h == std::hash<int*>()(ptr));
30 }
31