Skip to content

Commit

Permalink
Work around STF mdspan<const T> issue
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Jan 21, 2025
1 parent 10b5572 commit 59a3a4a
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ struct readonly_type_of
};

// Specialization of `readonly_type_of` for `mdspan`.
template <typename T, typename... More>
struct readonly_type_of<mdspan<T, More...>>
template <typename T, typename Extents, typename Layout, template <typename> class Accessor>
struct readonly_type_of<mdspan<T, Extents, Layout, Accessor<T>>>
{
using type = mdspan<const T, More...>;
using type = mdspan<T, Extents, Layout, Accessor<T>>;
};

// Helper struct to deduce read-write types.
Expand All @@ -73,17 +73,17 @@ struct rw_type_of
};

// Specialization of rw_type_of for `mdspan`.
template <typename T, typename... More>
struct rw_type_of<mdspan<const T, More...>>
template <typename T, typename Extents, typename Layout, template <typename> class Accessor>
struct rw_type_of<mdspan<const T, Extents, Layout, Accessor<const T>>>
{
using type = mdspan<T, More...>;
using type = mdspan<T, Extents, Layout, Accessor<T>>;
};

// Specialization of rw_type_of for const mdspan.
template <typename T, typename... More>
struct rw_type_of<const mdspan<const T, More...>>
template <typename T, typename Extents, typename Layout, template <typename> class Accessor>
struct rw_type_of<const mdspan<const T, Extents, Layout, Accessor<const T>>>
{
using type = mdspan<T, More...>;
using type = mdspan<T, Extents, Layout, Accessor<T>>;
};

} // namespace reserved
Expand Down

0 comments on commit 59a3a4a

Please sign in to comment.