← Back to team overview

dolfin team mailing list archive

reference and shared_ptr interfaces

 

Having just looked at the VariationalProblem class, there is
considerable duplication of functions that return objects (there being a
reference and a shared_ptr version). I suggest that we use shared_ptr
versions, unless there is a special reason to use a reference, and
remove the reference versions (throughout the code). Reasons for this are:

1) Less code

2) shared_ptrs are now handled seamlessly by SWIG

3) shared_ptr versions are safer

4) These member functions are usually called from other parts of the
library, and developers at that level should be comfortable with
shared_ptrs.

I can imagine that we may in a limited number of cases want a reference
version to keep the user interface clean.

Garth



Follow ups