First half of support for N3657; heterogenous lookups for set/multiset
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188241 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
22
test/support/private_constructor.hpp
Normal file
22
test/support/private_constructor.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef __PRIVATE_CONSTRUCTOR__H
|
||||
#define __PRIVATE_CONSTRUCTOR__H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
struct PrivateConstructor {
|
||||
|
||||
PrivateConstructor static make ( int v ) { return PrivateConstructor(v); }
|
||||
int get () const { return val; }
|
||||
private:
|
||||
PrivateConstructor ( int v ) : val(v) {}
|
||||
int val;
|
||||
};
|
||||
|
||||
bool operator < ( const PrivateConstructor &lhs, const PrivateConstructor &rhs ) { return lhs.get() < rhs.get(); }
|
||||
|
||||
bool operator < ( const PrivateConstructor &lhs, int rhs ) { return lhs.get() < rhs; }
|
||||
bool operator < ( int lhs, const PrivateConstructor &rhs ) { return lhs < rhs.get(); }
|
||||
|
||||
std::ostream & operator << ( std::ostream &os, const PrivateConstructor &foo ) { return os << foo.get (); }
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user