dglaeser/gridformat

[reader] use `std::optional` instead of throwing

Closed this issue · 1 comments

Currently, the optional reader interfaces (extents, etc, which are special to structured grids), throw in the default implementation in the base reader. We could change this to returning std::optionals. This would allow users to write logic compatible with both structured and unstructured formats without the need for try/catch blocks.

Closing this because:

The semantics when instantiating a reader bound to a specific format, e.g. vti are much better when not using optional. It would be arbitrary that in this case some interfaces return optional, while some return values directly.