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