Add util::cast<T>(span)
This commit is contained in:
parent
e557fd4eaf
commit
4403266feb
1 changed files with 6 additions and 0 deletions
|
|
@ -95,4 +95,10 @@ namespace psemek::util
|
||||||
return !(s1 == s2);
|
return !(s1 == s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T, typename H>
|
||||||
|
span<T> cast(span<H> const & s)
|
||||||
|
{
|
||||||
|
return span<T>{reinterpret_cast<T *>(s.begin()), reinterpret_cast<T *>(s.end())};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue