Allocates a new vector of the specified size via the default allocator. Elements in the new vector are value-initialized.
| 205 | // Allocates a new vector of the specified size via the default allocator. |
| 206 | // Elements in the new vector are value-initialized. |
| 207 | static OwnedVector<T> New(size_t size) { |
| 208 | if (size == 0) return {}; |
| 209 | return OwnedVector<T>(std::make_unique<T[]>(size), size); |
| 210 | } |
| 211 | |
| 212 | // Allocates a new vector of the specified size via the default allocator. |
| 213 | // Elements in the new vector are default-initialized. |
no outgoing calls