Add support for passing rvalue to DataCollector to writers
This adds support for passing temporary DataCollector
s to the writer
constructors by:
- Adding a constructor from
DataCollector&&
to theVtkWriterBase
. This forwards the temporary tostd::make_shared
and thus takes ownership of the passedDataCollector
. - Adding deduction guides for the writer implementations.
This allows to fully rely on type deduction and construct a writer with plain value semantics, e.g.
auto writer = UnstructuredGridWriter(LagrangeDataCollector(gridView, 2));
Disclaimer: I only tested the exact combination given in the example. The other ones are implemented the same way but have not been tested.