## `object::capacity`

Return the number of elements that can be held in currently allocated memory.

### Synopsis

    std::size_t
    capacity() const noexcept;

### Description

Returns the number of elements that the container has currently allocated space for. This number is never smaller than the value returned by `size()`.

### Complexity

Constant.

### Exception Safety

No-throw guarantee.

Edit this page