summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvarlengtharray.h
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-04-06 19:10:10 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-04-06 19:10:25 +0200
commit20cac3d9c9c22153e9e316daff32b6050ff6be6b (patch)
treeb563a89475df9afb4f40841ec371be9488d5b1ed /src/corelib/tools/qvarlengtharray.h
parent8ce85d74b692392a4ea0785360156f37418cff13 (diff)
parent9eb0b09abce28b11e4915fc9c3b3e996eb19cef2 (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Diffstat (limited to 'src/corelib/tools/qvarlengtharray.h')
-rw-r--r--src/corelib/tools/qvarlengtharray.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 2933e40549..bb15d66439 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -92,6 +92,15 @@ public:
return *this;
}
+#ifdef Q_COMPILER_INITIALIZER_LISTS
+ QVarLengthArray<T, Prealloc> &operator=(std::initializer_list<T> list)
+ {
+ resize(list.size());
+ std::copy(list.begin(), list.end(), this->begin());
+ return *this;
+ }
+#endif
+
inline void removeLast() {
Q_ASSERT(s > 0);
realloc(s - 1, a);