aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/array.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/array.h b/common/array.h
index 1645db05b1..d4dac35866 100644
--- a/common/array.h
+++ b/common/array.h
@@ -63,9 +63,10 @@ public:
* Constructs an array with `count` default-inserted instances of T. No
* copies are made.
*/
- explicit Array(size_type count) : _size(0) {
+ explicit Array(size_type count) : _size(count) {
allocCapacity(count);
- resize(count);
+ for (size_type i = 0; i < count; ++i)
+ new ((void *)&_storage[i]) T();
}
/**