Fix creating util::span<T const> from an array of non-const T

This commit is contained in:
Nikita Lisitsa 2023-08-22 14:52:51 +03:00
parent 79e90fb03c
commit 190fd5e51e

View file

@ -46,6 +46,13 @@ namespace psemek::util
, p_end{a + N}
{}
template <std::size_t N>
requires (!std::is_same_v<T, std::remove_cv_t<T>>)
span(std::remove_cv_t<T> (&a)[N])
: p_begin{a}
, p_end{a + N}
{}
template <typename Container>
span(Container && a)
: p_begin{a.data()}