Fortran Arrays in C++

I think the three features that would be nice are,

  • cast to Fortran array descriptor CFI_cdesc_t *
  • multidimensional array subscript operator A[i,j,k] (since C++23)
  • cast to C++23 mdspan

The Fortran array descriptor would allow you to interoperate with Fortran codes using assumed-shape array arguments. There is a little example here: C interoperability with assumed-shape arrays - #12 by ivanpribec

2 Likes