Skip to content

[cleanup] Hide FlatVectorBackend in favour of flatVectorView()

Carsten Gräser requested to merge feature/introduce-flatvectorview into master
  • Hide the old implementation class FlatVectorBackend in namespace Impl::. It was never documented anyway.
  • Add a new class FlatVectorView. In contrast to the old one, this behaves like a (view-) value providing a very slim flat-vector-like interface instead of odd static methods.
  • To be flexible FlatVectorView is also hidden in Impl:: Instead we only expose factory methods:
  • Add factory methods flatVectorView() creating the view objects. When passing a const/mutable l-value reference the returned object will store a pointer to the underlying container. If the passed container is an r-value reference the object will be stored by value inside of the view. This is necessary to support proxy objects.

Strictly speaking this is an interface change: The header is renamed and the old class is moved to Impl::. However it was in fact an implementation detail needed by interpolate() and DiscreteBasisGridFunction and not documented at all. Notice that the newly exposed public and documented interface is much slimmer and cleaner.

Merge request reports