Files
cppdraft_translate/cppdraft/array/members.md
2025-10-25 03:02:53 +03:00

1.7 KiB
Raw Blame History

[array.members]

23 Containers library [containers]

23.3 Sequence containers [sequences]

23.3.3 Class template array [array]

23.3.3.3 Member functions [array.members]

🔗

constexpr size_type size() const noexcept;

1

#

Returns: N.

🔗

constexpr T* data() noexcept; constexpr const T* data() const noexcept;

2

#

Returns: A pointer such that [data(), data() + size()) is a valid range.

For a non-empty array, data() == addressof(front()) is true.

🔗

constexpr void fill(const T& u);

3

#

Effects: As if by fill_n(begin(), N, u).

🔗

constexpr void swap(array& y) noexcept(is_nothrow_swappable_v<T>);

4

#

Effects: Equivalent to swap_ranges(begin(), end(), y.begin()).

5

#

[Note 1:

Unlike the swap function for other containers, array::swap takes linear time, can exit via an exception, and does not cause iterators to become associated with the other container.

— end note]