aboutsummaryrefslogtreecommitdiff
path: root/test/std/containers/associative/multimap/multimap.cons/compare_copy_constructible.fail.cpp
blob: 3d33f721a56d6bb4faf5bafc41d38bbcbcc4fa76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <map>

// Check that std::multimap fails to instantiate if the comparison predicate is
// not copy-constructible. This is LWG issue 2436

#include <map>

template <class T>
struct Comp {
	bool operator () (const T& lhs, const T& rhs) const { return lhs < rhs; }

	Comp () {}
private:
	Comp (const Comp &); // declared but not defined
	};


int main() {
	std::multimap<int, int, Comp<int> > m;
}