kokkos / mdspan

Reference implementation of mdspan targeting C++23
Other
415 stars 69 forks source link

Godbolt example broken #259

Open adayton1 opened 1 year ago

adayton1 commented 1 year ago

It looks like the latest commit to the single-header branch broke things. There are a bunch of errors regarding redefinitions (one example is below):

In file included from <source>:11:
/app/raw.githubusercontent.com/kokkos/mdspan/single-header/mdspan.hpp:1111:8: error: redefinition of 'struct std::default_accessor<ElementType>'
 1111 | struct default_accessor {
      |        ^~~~~~~~~~~~~~~~
/app/raw.githubusercontent.com/kokkos/mdspan/single-header/mdspan.hpp:1011:8: note: previous definition of 'struct std::default_accessor<ElementType>'
 1011 | struct default_accessor {
      |        ^~~~~~~~~~~~~~~~

I went back to the previous commit and it worked fine (https://raw.githubusercontent.com/kokkos/mdspan/15563ed9ab955f8a2e555181a71583a9913816c2/mdspan.hpp instead of https://raw.githubusercontent.com/kokkos/mdspan/single-header/mdspan.hpp).

crtrott commented 1 year ago

I think this will fix it. https://github.com/kokkos/mdspan/pull/260 Note that by default however the single header will give you mdspan from now on in the Kokkos:: namespace.

Technically we are not allowed to inject things into the std:: namespace without being a stdandard library implementation.