Here is a summary of the array method. For details, refer to the following link:
Public member function <array> STD: array: Size
constexpr size_type size() noexcept;
Returns the number of elements in the array. Parametersnone
Return Value
The number of elements in array.
Address: http://blog.csdn.net/qq844352155/article/details/38944721
---------------------------------------------------
Public member function <array> STD: array: max_size
constexpr size_type max_size() noexcept;
Returns the maximum number of elements that an array container can store. Max_size of array is as big as size, which is generally equal to the second template parameter during instantiation. (Unlike vector)
Parametersnone
Return Value
Returns the maximum number of elements that an array can store,
This is a constant.
Address: http://blog.csdn.net/qq844352155/article/details/38943923
------------------------------------------------- Public member function <array> STD: array: empty
constexpr bool empty() noexcept;
Test whether array is empty. Parametersnone
Return Value
Returns true if array size is 0; otherwise, returns false.
Address: http://blog.csdn.net/qq844352155/article/details/38879921
---------------------------------------------------
Public member function <array> STD: array: Fill
void fill (const value_type& val);
Set Val to the values of all elements in array. Parameters
-
Val
-
Val is used to fill in the array value.
-
Return Value
None if the element value assignment throws an exception, it throws an exception.
Address: http://blog.csdn.net/qq844352155/article/details/38943777
__________________________________________________________________________________________________ Public member function <array> STD: array: swap
void swap (array& x) noexcept(noexcept(swap(declval<value_type&>(),declval<value_type&>())));
Exchanges content with X, which is an array of the same type (including the size ).
Parameters
-
X
X is an array of the same type (the same size), and the array to be exchanged with this array.
Return valuenone.
Address: http://blog.csdn.net/qq844352155/article/details/38944863
------------------------------------------------------------------
// Please give me more guidance on the bad summary. You can leave a message below or click the email address in the upper-left corner to send an email to me, pointing out my errors and shortcomings, so that I can modify them, thank you for sharing it.
Reprinted please indicate the source: http://blog.csdn.net/qq844352155
Author: unparalleled
Email: [email protected]
November
Yu gdut
------------------------------------------------------------------
STL array method summary (2) Capacity and modifiers (21)