00001 00002 /* 00003 * @htmlonly 00004 * Copyright © 2008-2009 00005 * @endhtmlonly 00006 * Instigate CJSC, Armenia 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free 00020 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00021 */ 00022 00023 #ifndef _INSTIGATE_OPEN_SOURCE_INTERNAL_HEADER_IN_CONCEPT 00024 #error This is an internal header file used to implement Instigate Open Source.\ 00025 It should never be included directly by a program. 00026 #endif 00027 00028 #ifndef INSTIGATE_GENERIC_LESS_THAN_COMPARABLE_HPP 00029 #define INSTIGATE_GENERIC_LESS_THAN_COMPARABLE_HPP 00030 00039 // Headers from this project 00040 00041 // Headers from other projects 00042 00043 // Headers from standard libraries 00044 00045 // Forward declarations 00046 namespace instigate { 00056 namespace less_than_comparable { 00057 struct tag; 00058 template<typename T> struct interface; 00059 template<typename T> struct requirements; 00060 } 00061 } 00062 00069 struct instigate::less_than_comparable::tag 00070 { 00071 }; 00072 00076 template<typename T> 00077 struct instigate::less_than_comparable::interface 00078 { 00088 static bool less_than(const T& a, const T& b) 00089 { 00090 return a < b; 00091 } 00092 }; 00093 00102 template<typename T> 00103 struct instigate::less_than_comparable::requirements 00104 { 00109 static void require_less_than(const T& a, const T& b) 00110 { 00111 instigate::less_than_comparable::interface<T>::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 k = instigate::less_than_comparable:: 00122 interface<T>::less_than(a, b); 00123 (void)k; 00124 } 00125 00133 requirements() 00134 { 00135 (void)&requirements<T>::require_less_than; 00136 (void)&requirements<T>::return_type_must_be_convertible_to_bool; 00137 } 00138 /*private: 00140 requirements(const requirements&) throw(); 00141 00143 requirements& operator=(const requirements&) throw(); 00144 */ 00145 }; 00146 00147 // vim:et:tabstop=8:shiftwidth=8:cindent:fo=croq:textwidth=80: 00148 00149 #endif // INSTIGATE_GENERIC_LESS_THEN_COMPARABLE_HPP