]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/std/containers/unord/unord.multimap/unord.multimap.cnstr/compare_copy_constructible.fail.cpp
Vendor import of libc++ trunk r290819:
[FreeBSD/FreeBSD.git] / test / std / containers / unord / unord.multimap / unord.multimap.cnstr / compare_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 // UNSUPPORTED: c++98, c++03
11 // The test requires access control SFINAE.
12
13 // <unordered_map>
14
15 // Check that std::unordered_multimap fails to instantiate if the comparison predicate is
16 // not copy-constructible. This is LWG issue 2436
17
18 #include <unordered_map>
19
20 template <class T>
21 struct Comp {
22         bool operator () (const T& lhs, const T& rhs) const { return lhs == rhs; }
23
24         Comp () {}
25 private:
26         Comp (const Comp &); // declared but not defined
27         };
28
29
30 int main() {
31         std::unordered_multimap<int, int, std::hash<int>, Comp<int> > m;
32 }