Pre-allocate size.
Declared in <folly/json/dynamic.h>
void
reserve(std::size_t capacity);
If this is an array, an object, or a string, reserves the requested capacity in the underlying container. Otherwise throws TypeError.
May invalidate iterators, and does not give any additional guarantees on iterator invalidation on subsequent insertions; the only purpose is for optimization.
methodset Container
| Name | Description |
|---|---|
| capacity | The number of elements to reserve capacity for. |