On Mon, Oct 27, 2008 at 04:39:52PM +0100, Martin Sandve Alnæs wrote: > What about generating code to do this: > > FooFunctionSpace V(mesh); > FooForm a(V, V) > Function f(V); > > a.f = &f; // can't use reference
We can let the object f be a variable of some new type (not Function) and then overload operator= for that type to make this possible. The assignment would then result in a function call which is safer but allows the nice syntax. -- Anders > or > > a.set_f(f); // allow both reference and shared_ptr > a.set_g(g); > > this requires reserving the names set_* in Form. >
signature.asc
Description: Digital signature
_______________________________________________ DOLFIN-dev mailing list [email protected] http://www.fenics.org/mailman/listinfo/dolfin-dev
