BLI: don't allow mutable span of initializer list

This commit is contained in:
Jacques Lucke 2020-07-13 10:49:59 +02:00
parent 0718c6fae0
commit 644a915b1b
1 changed files with 0 additions and 15 deletions

View File

@ -440,21 +440,6 @@ template<typename T> class MutableSpan {
{
}
/**
* Reference an initializer_list. Note that the data in the initializer_list is only valid until
* the expression containing it is fully computed.
*
* Do:
* call_function_with_array({1, 2, 3, 4});
*
* Don't:
* MutableSpan<int> span = {1, 2, 3, 4};
* call_function_with_array(span);
*/
MutableSpan(std::initializer_list<T> &list) : MutableSpan(list.begin(), list.size())
{
}
MutableSpan(std::vector<T> &vector) : MutableSpan(vector.data(), vector.size())
{
}