Bug 690670, part 0: Add helpers for copy-constructing auto arrays from regular arrays. r=roc

--HG--
extra : rebase_source : e586553e4a2cf344f72347e195f42762f0183c99
This commit is contained in:
Chris Jones 2011-10-05 15:15:45 -07:00
parent ed065074ae
commit 31b4fa2a5b

View File

@ -1284,6 +1284,11 @@ class nsAutoTArray : public nsAutoArrayBase<nsTArray<E, Alloc>, N>
{
public:
nsAutoTArray() {}
template<typename Allocator>
nsAutoTArray(const nsTArray<E, Allocator>& other) {
AppendElements(other);
}
};
template<class E, PRUint32 N>
@ -1291,6 +1296,11 @@ class AutoFallibleTArray : public nsAutoArrayBase<FallibleTArray<E>, N>
{
public:
AutoFallibleTArray() {}
template<typename Allocator>
AutoFallibleTArray(const nsTArray<E, Allocator>& other) {
AppendElements(other);
}
};
#if defined(MOZALLOC_HAVE_XMALLOC)
@ -1299,6 +1309,11 @@ class AutoInfallibleTArray : public nsAutoArrayBase<InfallibleTArray<E>, N>
{
public:
AutoInfallibleTArray() {}
template<typename Allocator>
AutoInfallibleTArray(const nsTArray<E, Allocator>& other) {
AppendElements(other);
}
};
#endif