Files
cppdraft_translate/cppdraft/inplace/vector/capacity.md
2025-10-25 03:02:53 +03:00

2.8 KiB

[inplace.vector.capacity]

23 Containers library [containers]

23.3 Sequence containers [sequences]

23.3.16 Class template inplace_vector [inplace.vector]

23.3.16.3 Capacity [inplace.vector.capacity]

🔗

static constexpr size_type capacity() noexcept; static constexpr size_type max_size() noexcept;

1

#

Returns: N.

🔗

constexpr void resize(size_type sz);

2

#

Preconditions: T is Cpp17DefaultInsertable into inplace_vector.

3

#

Effects: If sz < size(), erases the last size() - sz elements from the sequence.

Otherwise, appends sz - size() default-inserted elements to the sequence.

4

#

Remarks: If an exception is thrown, there are no effects on *this.

🔗

constexpr void resize(size_type sz, const T& c);

5

#

Preconditions: T is Cpp17CopyInsertable into inplace_vector.

6

#

Effects: If sz < size(), erases the last size() - sz elements from the sequence.

Otherwise, appends sz - size() copies of c to the sequence.

7

#

Remarks: If an exception is thrown, there are no effects on *this.

🔗

static constexpr void reserve(size_type n);

8

#

Effects: None.

9

#

Throws: bad_alloc if n > capacity() is true.

🔗

static constexpr void shrink_to_fit() noexcept;

10

#

Effects: None.