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