17 #ifndef VCSN_DESIGN_PATTERN_DEFAULT_OPS_HXX
18 # define VCSN_DESIGN_PATTERN_DEFAULT_OPS_HXX
30 template<
typename S,
typename T>
40 template<
typename S,
typename T,
typename U>
48 template<
typename S,
typename T,
typename U>
57 template<
typename S,
typename V,
typename T,
typename U>
66 template<
typename S,
typename V,
typename T,
typename U>
79 template<
typename S,
typename R,
typename T>
83 return static_cast<R
>(data);
86 template<
typename S,
typename T>
93 template<
typename S,
typename T>
97 precondition(& s1 == & s2);
98 static_cast<void> (s1);
static_cast<void> (s2);
102 template<
typename S,
typename T>
103 const S& op_convert(
const Structure<S>&,
const Structure<T>&)
105 static_error(no_convertion_operator_available);
113 template<
typename S,
typename T>
123 template<
typename S,
typename T>
135 template<
typename S,
typename T,
typename U>
142 template<
typename S,
typename T,
typename U>
148 precondition(& s1 == & s2);
153 # define INOP_IMPL(Name) \
154 template<typename S, typename T, typename U> \
155 void op_in_ ## Name (const Structure<S>& s1, \
156 const Structure<S>& s2, \
160 precondition(& s1 == & s2); \
162 return op_in_ ## Name (s1.self(), dst, arg); \
174 # define BINOP_IMPL(Name) \
175 template<typename S, typename T, typename U> \
176 T op_ ## Name (const Structure<S>& s1, \
177 const Structure<S>& s2, \
181 precondition(& s1 == & s2); \
183 return op_ ## Name(s1.self(), v1, v2); \
193 template<
typename S,
typename St,
typename T>
199 template<
typename S,
typename St,
typename T>
208 #endif // ! VCSN_DESIGN_PATTERN_DEFAULT_OPS_HXX