Add util::make_span(initializer_list)
This commit is contained in:
parent
20574e23e3
commit
d27d4cca17
1 changed files with 6 additions and 0 deletions
|
|
@ -127,4 +127,10 @@ namespace psemek::util
|
||||||
return span<T>{reinterpret_cast<T *>(s.begin()), reinterpret_cast<T *>(s.end())};
|
return span<T>{reinterpret_cast<T *>(s.begin()), reinterpret_cast<T *>(s.end())};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
span<T const> make_span(std::initializer_list<T> const & list)
|
||||||
|
{
|
||||||
|
return {list.begin(), list.end()};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue