00001 00002 #ifndef _INSTIGATE_OPEN_SOURCE_INTERNAL_HEADER_IN_CONCEPT 00003 #error This is an internal header file used to implement Instigate Algebra.\ 00004 It should never be included directly by a program. 00005 #endif 00006 00007 #ifndef INSTIGATE_ALGEBRA_MULTIPLICATIVE_MONOID_HPP 00008 #define INSTIGATE_ALGEBRA_MULTIPLICATIVE_MONOID_HPP 00009 00034 // headers from this project 00035 #include "_multiplicative_semi_group.hpp" 00036 00037 // headers from other project 00038 #include <generic/base.hpp> 00039 00040 // headers from standard project 00041 00042 // forward declarations 00043 namespace instigate { 00044 00045 namespace algebra { 00046 00058 namespace multiplicative_monoid { 00059 struct tag; 00060 template<typename T> struct interface; 00061 template<typename T> struct requirements; 00062 00063 } // namespace instigate::algebra::multiplicative_monoid 00064 00065 } // namespace instigate::algebra 00066 00067 } // namespace instigate 00068 00075 struct instigate::algebra::multiplicative_monoid::tag: 00076 instigate::algebra::multiplicative_semi_group::tag {}; 00077 00082 template<typename T> 00083 struct instigate::algebra::multiplicative_monoid::interface : 00084 instigate::algebra::multiplicative_semi_group::interface<T> 00085 { 00091 static T get_one() 00092 { 00093 return instigate::algebra::interface<T>::get_one(); 00094 } 00095 }; 00096 00104 template<typename T> 00105 struct instigate::algebra::multiplicative_monoid::requirements : 00106 instigate::algebra::multiplicative_semi_group::requirements<T> 00107 { 00108 00113 static void require_get_one() 00114 { 00115 instigate::algebra::multiplicative_monoid::interface<T>:: 00116 get_one(); 00117 } 00118 00123 static void require_get_one_return_type(const T& a) 00124 { 00125 REQUIRE_SAME_TYPE(a, interface<T>::get_one()); 00126 } 00127 00135 requirements() 00136 { 00137 (void)&require_get_one; 00138 (void)&require_get_one_return_type; 00139 } 00140 }; 00141 00142 // vim:et:tabstop=8:shiftwidth=8:cindent:fo=croq: 00143 00144 #endif // INSTIGATE_ALGEBRA_MULTIPLICATIVE_MONOID_HPP 00145