зеркало из https://github.com/mozilla/gecko-dev.git
Bug 968520 - Add more fallible variants of nsTArray::InsertElementsAt. r=froydnj
This commit is contained in:
Родитель
8b524164fa
Коммит
2db38a1d84
|
@ -1292,19 +1292,37 @@ public:
|
|||
}
|
||||
|
||||
// A variation on the ReplaceElementsAt method defined above.
|
||||
template<class Item>
|
||||
template<class Item, typename ActualAlloc = Alloc>
|
||||
elem_type* InsertElementsAt(index_type aIndex, const Item* aArray,
|
||||
size_type aArrayLen)
|
||||
{
|
||||
return ReplaceElementsAt(aIndex, 0, aArray, aArrayLen);
|
||||
return ReplaceElementsAt<Item, ActualAlloc>(aIndex, 0, aArray, aArrayLen);
|
||||
}
|
||||
|
||||
template<class Item>
|
||||
/* MOZ_WARN_UNUSED_RESULT */
|
||||
elem_type* InsertElementsAt(index_type aIndex, const Item* aArray,
|
||||
size_type aArrayLen, const mozilla::fallible_t&)
|
||||
{
|
||||
return InsertElementsAt<Item, FallibleAlloc>(aIndex, aArray, aArrayLen);
|
||||
}
|
||||
|
||||
// A variation on the ReplaceElementsAt method defined above.
|
||||
template<class Item, class Allocator>
|
||||
template<class Item, class Allocator, typename ActualAlloc = Alloc>
|
||||
elem_type* InsertElementsAt(index_type aIndex,
|
||||
const nsTArray_Impl<Item, Allocator>& aArray)
|
||||
{
|
||||
return ReplaceElementsAt(aIndex, 0, aArray.Elements(), aArray.Length());
|
||||
return ReplaceElementsAt<Item, ActualAlloc>(
|
||||
aIndex, 0, aArray.Elements(), aArray.Length());
|
||||
}
|
||||
|
||||
template<class Item, class Allocator>
|
||||
/* MOZ_WARN_UNUSED_RESULT */
|
||||
elem_type* InsertElementsAt(index_type aIndex,
|
||||
const nsTArray_Impl<Item, Allocator>& aArray,
|
||||
const mozilla::fallible_t&)
|
||||
{
|
||||
return InsertElementsAt<Item, Allocator, FallibleAlloc>(aIndex, aArray);
|
||||
}
|
||||
|
||||
// Insert a new element without copy-constructing. This is useful to avoid
|
||||
|
|
Загрузка…
Ссылка в новой задаче