mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 968520 - Add more fallible variants of nsTArray::InsertElementsAt. r=froydnj
This commit is contained in:
parent
c84827bad2
commit
67cae0519f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user