summaryrefslogtreecommitdiffstats
path: root/libcxx/test/support/private_constructor.hpp
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2013-08-13 01:11:06 +0000
committerMarshall Clow <mclow.lists@gmail.com>2013-08-13 01:11:06 +0000
commit25d3402c6a595cdf5555a82de0eee8d8a58df25a (patch)
treead70a64b9844d4991098591286de6b47a3f84a11 /libcxx/test/support/private_constructor.hpp
parentf09a3dbf92b0f9b0c041a80f862147b03237ce1e (diff)
downloadbcm5719-llvm-25d3402c6a595cdf5555a82de0eee8d8a58df25a.tar.gz
bcm5719-llvm-25d3402c6a595cdf5555a82de0eee8d8a58df25a.zip
First half of support for N3657; heterogenous lookups for set/multiset
llvm-svn: 188241
Diffstat (limited to 'libcxx/test/support/private_constructor.hpp')
-rw-r--r--libcxx/test/support/private_constructor.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/libcxx/test/support/private_constructor.hpp b/libcxx/test/support/private_constructor.hpp
new file mode 100644
index 00000000000..3f6f0d3d0ed
--- /dev/null
+++ b/libcxx/test/support/private_constructor.hpp
@@ -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
OpenPOWER on IntegriCloud