Make List constructor with capacity reserve the space, instead of creating the vector with a set size.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
409b52bbf7
commit
846a9380a7
|
@ -16,7 +16,7 @@ namespace Arbutils::Collections {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
List() : _vector() {}
|
List() : _vector() {}
|
||||||
explicit List(size_t capacity) : _vector(capacity) {}
|
explicit List(size_t capacity) : _vector(0) { _vector.reserve(capacity); }
|
||||||
List(const std::initializer_list<ValueT>& l) : _vector(l) {}
|
List(const std::initializer_list<ValueT>& l) : _vector(l) {}
|
||||||
List(const ValueT* begin, const ValueT* end) : _vector(begin, end) {}
|
List(const ValueT* begin, const ValueT* end) : _vector(begin, end) {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue