00001
00002 #ifndef _INSTIGATE_OPEN_SOURCE_INTERNAL_HEADER_IN_CONCEPT
00003 #error This is an internal header file used to implement Instigate Open Source.\
00004 It should never be included directly by a program.
00005 #endif
00006
00007 #ifndef INSTIGATE_GENERIC_LESS_THAN_COMPARABLE_HPP
00008 #define INSTIGATE_GENERIC_LESS_THAN_COMPARABLE_HPP
00009
00033
00034
00035
00036
00037
00038
00039
00040
00041 namespace instigate {
00042 namespace generic {
00053 namespace less_than_comparable {
00054 struct tag;
00055 template<typename T> struct interface;
00056 template<typename T> struct requirements;
00057 }
00058 }
00059 }
00060
00067 struct instigate::generic::less_than_comparable::tag
00068 {
00069 };
00070
00074 template<typename T>
00075 struct instigate::generic::less_than_comparable::interface
00076 {
00086 static bool less_than(const T& a, const T& b)
00087 {
00088 return a < b;
00089 }
00090 };
00091
00100 template<typename T>
00101 struct instigate::generic::less_than_comparable::requirements
00102 {
00103 private:
00108 static void require_less_than(const T& a, const T& b)
00109 {
00110 instigate::generic::less_than_comparable::interface<T>
00111 ::less_than(a, b);
00112 }
00113
00118 static void return_type_must_be_convertible_to_bool(const T& a,
00119 const T& b)
00120 {
00121 (bool)instigate::generic::less_than_comparable::
00122 interface<T>::less_than(a, b);
00123 }
00124 public:
00125
00133 requirements()
00134 {
00135 (void)require_less_than;
00136 (void)return_type_must_be_convertible_to_bool;
00137 }
00138 };
00139
00140
00141
00142 #endif // INSTIGATE_GENERIC_LESS_THEN_COMPARABLE_HPP