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_MAGMA_HPP 00008 #define INSTIGATE_ALGEBRA_MULTIPLICATIVE_MAGMA_HPP 00009 00034 // Headers from this project 00035 00036 // Headers from other project 00037 #include <generic/_assignable.hpp> 00038 #include <generic/base.hpp> 00039 00040 // Headers from standard project 00041 00042 // forward declarations 00043 00044 namespace instigate { 00045 00046 namespace algebra { 00047 00061 namespace multiplicative_magma { 00062 struct tag; 00063 template<typename T> struct interface; 00064 template<typename T> struct requirements; 00065 00066 } // namespace instigate::algebra::multiplicative_magma 00067 00068 } // namespace instigate::algebra 00069 00070 } // namespace instigate 00071 00078 struct instigate::algebra::multiplicative_magma::tag : 00079 instigate::assignable::tag {}; 00080 00085 template<typename T> 00086 struct instigate::algebra::multiplicative_magma::interface : 00087 instigate::assignable::interface<T> 00088 { 00097 static T multiply(const T& a, const T& b) 00098 { 00099 return instigate::algebra::interface<T>::multiply(a, b); 00100 } 00101 }; 00102 00111 template<typename T> 00112 struct instigate::algebra::multiplicative_magma::requirements : 00113 instigate::assignable::requirements<T> 00114 { 00119 static void require_multiply(const T& a, const T& b) 00120 { 00121 instigate::algebra::multiplicative_magma::interface<T>:: 00122 multiply(a, b); 00123 } 00124 00129 static void require_multiply_return_type(const T& a, const T& b) 00130 { 00131 REQUIRE_SAME_TYPE(a, interface<T>::multiply(a, b)); 00132 } 00133 00140 requirements() 00141 { 00142 (void)&require_multiply; 00143 (void)&require_multiply_return_type; 00144 } 00145 }; 00146 00147 // vim:et:tabstop=8:shiftwidth=8:cindent:fo=croq: 00148 00149 #endif // INSTIGATE_ALGEBRA_MULTIPLICATIVE_MAGMA_HPP 00150