diff --git a/xpcom/glue/nsTArray.h b/xpcom/glue/nsTArray.h index 8f7f3c77a78c..db0c98119455 100644 --- a/xpcom/glue/nsTArray.h +++ b/xpcom/glue/nsTArray.h @@ -1284,6 +1284,11 @@ class nsAutoTArray : public nsAutoArrayBase, N> { public: nsAutoTArray() {} + + template + nsAutoTArray(const nsTArray& other) { + AppendElements(other); + } }; template @@ -1291,6 +1296,11 @@ class AutoFallibleTArray : public nsAutoArrayBase, N> { public: AutoFallibleTArray() {} + + template + AutoFallibleTArray(const nsTArray& other) { + AppendElements(other); + } }; #if defined(MOZALLOC_HAVE_XMALLOC) @@ -1299,6 +1309,11 @@ class AutoInfallibleTArray : public nsAutoArrayBase, N> { public: AutoInfallibleTArray() {} + + template + AutoInfallibleTArray(const nsTArray& other) { + AppendElements(other); + } }; #endif