]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/containers/unord/unord.set/unord.set.cnstr/hash_copy_constructible.fail.cpp
Vendor import of libc++ trunk r290819:
[FreeBSD/FreeBSD.git] / test / std / containers / unord / unord.set / unord.set.cnstr / hash_copy_constructible.fail.cpp
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 // <unordered_map>
11
12 // Check that std::unordered_set fails to instantiate if the hash function is
13 // not copy-constructible. This is mentioned in LWG issue 2436
14
15 #include <unordered_set>
16
17 template <class T>
18 struct Hash {
19         std::size_t operator () (const T& lhs) const { return 0; }
20
21         Hash () {}
22 private:
23         Hash (const Hash &); // declared but not defined
24         };
25
26
27 int main() {
28         std::unordered_set<int, Hash<int> > m;
29 }