Fix creating util::span<T const> from an array of non-const T
This commit is contained in:
parent
79e90fb03c
commit
190fd5e51e
1 changed files with 7 additions and 0 deletions
|
|
@ -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()}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue