Open molpopgen opened 3 years ago
Getting this right is a bit annoying. On the caller's side, one must use auto &&
to properly receive the shared_ptr
as const
.
This should be handled along with #294, at which point we should deprecate the existing types that do the const &
method.
Random thought: this may all be best handled by a get
method returning const *
?
Random thought: this may all be best handled by a
get
method returningconst *
?
No -- you can always delete a pointer. Seems like the smartest thing here is the shared/weak pointer duo.
We currently store an object and return a const reference via a getter. This design is rather inelegant. We should refactor to use shared pointers. The getter returns a pointer to const object to prevent modification by the caller.