forked from mirror/libcxx
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
760 B
C++
30 lines
760 B
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// 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::map 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::map<int, int, Comp<int> > m;
|
|
}
|