'assign' functions for Functions should not use shared pointers
Issue #913
new
For some reason, FunctionAssigner
methods and the free-functions assign
require shared pointer arguments even when they don't hold a pointer to the object being passed. The interface design is misleading.
If a reference is not hold, a plain reference interface should be used.
Comments (4)
-
-
reporter Ah. Would be nice if
Hierarchical
was removed. -
I guess you're right. But different mechanism would be needed for handling adaptive chain. (Maybe it can just be made much more explicit rather than letting DOLFIN hiding refined objects into existing ones.) I think @martinal also had a vague opinion how to refactor
Hierarchical
. -
@chris_richardson prototyped a hierarchy model separated from the objects in the hierarchy.
- Log in to comment
Didn't check the details now but I think that shared pointer is used because of
Hierarchical
. See #642, #643, and also #803; also note that C++17 featurestd::enable_shared_from_this
could be helpful here, see https://bitbucket.org/fenics-project/dolfin/issues/803/function-operator-is-missing#comment-34458052.