165
165
s op_t = (i == 1) ? raw_op_t : details+"::swapper<" + raw_op_t + ">";
166
166
s op_t_var = (i == 1) ? "raw_op_t" : details+"::swapper<raw_op_t>";
167
167
s op = (i == 1) ? "op_t()" : "op_t(raw_op_t())";
168
s arg_x = make_const_arg(arg1,"x");
169
s arg_y = make_const_arg(arg2,"y");
168
170
cout << "inline" << endl
169
171
<< root << "_vf_expr<" << endl
170
172
<< " " << root << "_vf_expr_binded_bf<" << endl
173
175
<< " ," << w_tst << endl
176
<< add_operator(o.name) << " (const " << arg1 << "& x, const " << arg2 << "& y)" << endl
178
<< add_operator(o.name) << " (" << arg_x << ", " << arg_y << ")" << endl
178
180
<< " typedef " << raw_op_t << " raw_op_t;" << endl
179
181
<< " typedef " << op_t_var << " op_t;" << endl
247
249
// and skip type errors as v/tensor or dot(v,tensor):
248
250
if (!o.have_arg (i, t)) continue;
249
251
// -----------------------------
250
// field_functor, Result=Float,point,tensor
251
253
// -----------------------------
252
254
cout << "template<class T, class M, class Fun, class VfTag>" << endl;
253
255
vf_multop_by_field_bind (o, details, i,
261
263
"field_expr_terminal_function<Fun>",
262
264
"field_vf_expr<Expr,VfTag>");
264
// ----------------------------------------
265
// function or class-function, Result=Float
266
// ----------------------------------------
267
// TODO: ajouter ici la classe fct si l'arg est unique (genre dot ou ddot)
268
// et sinon ajouter les vraies fonctions: pbs d'ecriture du typage dans le profil ?
266
// -----------------------------
268
// -----------------------------
269
cout << "template<class T, class M, class VfTag>" << endl;
270
vf_multop_by_field_bind (o, details, i,
271
valued(t,"T")+"(&)(const point_basic<T>&)",
272
"field_expr_terminal_function<"+valued(t,"T")+"(const point_basic<T>&)>",
273
"test_basic<T,M,VfTag>");
275
cout << "template<class Expr, class VfTag>" << endl;
276
vf_multop_by_field_bind (o, details, i,
277
valued(t,"typename Expr::scalar_type")+"(&)(const point_basic<typename Expr::scalar_type>&)",
278
"field_expr_terminal_function<"+valued(t,"typename Expr::scalar_type")+"(const point_basic<typename Expr::scalar_type>&)>",
279
"field_vf_expr<Expr,VfTag>");
280
// ----------------------------------------
281
// class-function, when Result=unique
282
// ----------------------------------------
283
// function<R(Arg)> are not distinguished by the return type => skip ambiguities
269
285
bool arg_is_unique = (o.arg(i) == v::s || o.arg(i) == v::p || o.arg(i) == v::t);
270
286
bool use_class_fct = (t == v::s) || arg_is_unique;
271
287
if (!use_class_fct) continue;