blob: 3f6f0d3d0ed0e8b85a50dde3ab5a80b4a695bf41 [file] [log] [blame]
Marshall Clow25d34022013-08-13 01:11:06 +00001#ifndef __PRIVATE_CONSTRUCTOR__H
2#define __PRIVATE_CONSTRUCTOR__H
3
4#include <iostream>
5
6struct PrivateConstructor {
7
8 PrivateConstructor static make ( int v ) { return PrivateConstructor(v); }
9 int get () const { return val; }
10private:
11 PrivateConstructor ( int v ) : val(v) {}
12 int val;
13 };
14
15bool operator < ( const PrivateConstructor &lhs, const PrivateConstructor &rhs ) { return lhs.get() < rhs.get(); }
16
17bool operator < ( const PrivateConstructor &lhs, int rhs ) { return lhs.get() < rhs; }
18bool operator < ( int lhs, const PrivateConstructor &rhs ) { return lhs < rhs.get(); }
19
20std::ostream & operator << ( std::ostream &os, const PrivateConstructor &foo ) { return os << foo.get (); }
21
22#endif