Home | History | Annotate | Download | only in multimap.cons
      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 // <map>
     11 
     12 // Check that std::multimap fails to instantiate if the comparison predicate is
     13 // not copy-constructible. This is LWG issue 2436
     14 
     15 #include <map>
     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::multimap<int, int, Comp<int> > m;
     29 }
     30