Skip to content

Use smart ptr for ignore nodes

lh1887 requested to merge feature/use-smart-ptr-ignorenodes into master

This MR introduces a shared_ptr for handling the ignore nodes via the CanIgnore class. That way dangling pointers will be less likely and one can be more confident in object lifetimes.

This, however, breaks the "interface" of directly assigning the member via a raw pointer:

this->ignoreNodes_ = &some_bitvector;

This MR already fixes this pattern for some dune-solvers classes by using the simple fix

this->setIgnore(some_bitvector);

which is essentially equivalent.

However, other modules (say dune-tnnmg) also rely on this and would need to be fixed. One could set up some hack to still allow the direct assignment but in fact (considering the trivial fix above) I'd prefer to just get rid of this pattern.

Edited by lh1887

Merge request reports

Loading