MDSA (Multi Dimensional Stride-Based Array-Views

A Proof of Concept exploring the Possibilities for Views and Sub-Views


  • Old code, written in C++14.
  • Header only.
  • Would benefit from newer C++ features such as std::span, std::optional,etc.
  • Some use cases likely not standard compliant, should be fixable.
  • Heavy use of assert, compile with NDEBUG for good performance.
  • Internal representation: A pointer to the element at index zero. For each dimension a size and a stride.
  • Support for the following sub-view types:
    • Spatial: A segment/rectangle/hyperrectangle of the original view. Applies offset and size.
    • Dimensional: Fix any dimension to an arbitrary value, creating a lower-dimensional array-view.
    • Reference Castable: Array-view to elements of a parent type (inheritance) and/or a type with added cv-qualifiers.
    • Member: A sub-view that only references a single struct-member of the original view's element type.

Download source code: tar.gz