Cherry-pick changes to polymorphicsmallobject
requested to merge simon.praetorius/dune-functions:cherry-pick/polymorphicsmallobject-2.6 into releases/2.6
This MR contains the changes to polymorphicsmallobject.hh
from MR !253 (merged) and !259 (merged)