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_SEMI_GROUP_HPP 00008 #define INSTIGATE_ALGEBRA_SEMI_GROUP_HPP 00009 00034 // Headers from this project 00035 #include "_additive_magma.hpp" 00036 #include "interface.hpp" 00037 00038 // Headers from other projects 00039 #include <generic/base.hpp> 00040 00041 // Headers from standard libraries 00042 00043 // Forward declarations 00044 namespace instigate { 00045 00046 namespace algebra { 00047 00056 namespace additive_semi_group { 00057 00058 struct tag; 00059 00060 template <typename T> 00061 struct interface; 00062 00063 template <typename T> 00064 struct requirements; 00065 00066 } // namespace instigate::algebra::additive_semi_group 00067 00068 } // namespace instigate::algebra 00069 00070 } // namespace instigate 00071 00078 struct instigate::algebra::additive_semi_group::tag : 00079 instigate::algebra::additive_magma::tag {}; 00080 00086 template <typename T> 00087 struct instigate::algebra::additive_semi_group::interface : 00088 instigate::algebra::additive_magma::interface<T> 00089 { 00094 static const bool is_specialized = instigate::algebra:: 00095 interface<T>::is_additive_assocativity; 00096 }; 00097 00106 template <typename T> 00107 struct instigate::algebra::additive_semi_group::requirements : 00108 instigate::algebra::additive_magma::requirements<T> 00109 { 00110 00112 static void require_associativity() 00113 { 00114 CHECK(instigate::generic::require<instigate:: 00115 algebra::additive_semi_group::interface<T>::is_specialized>); 00116 } 00117 00124 requirements() 00125 { 00126 (void)&require_associativity; 00127 }; 00128 }; 00129 00130 // vim:et:tabstop=8:shiftwidth=8:cindent:fo=croq:textwidth=80: 00131 00132 #endif //INSTIGATE_ALGEBRA_SEMI_GROUP_HPP