kokkos / mdspan

Reference implementation of mdspan targeting C++23
Other
398 stars 65 forks source link

Cannot build with exceptions disabled #316

Closed burnpanck closed 6 months ago

burnpanck commented 6 months ago

There is a single throw in the source in layout_right.hpp: https://github.com/kokkos/mdspan/blob/0e6a69dfe045acbb623003588a4aff844ea4b276/include/experimental/__p0009_bits/layout_right.hpp#L164-L167

This prevents the library from compiling with -fno-exceptions, typical for embedded environments. The comment states that this indeed causes a terminate anyway, it would probably be better to use std::terminate or std::abort directly.

Interestingly, the matching throw within layout_left.hpp must have been refactored to that end some time between v0.6.0 and stable: https://github.com/kokkos/mdspan/blob/879869d6740c47d40c02754cc05e241c1c66520f/include/experimental/__p0009_bits/layout_left.hpp#L164-L165

So this looks like an unfinished refactor to me.