|
3148 | 3148 | template<class T, size_t N>
|
3149 | 3149 | constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));
|
3150 | 3150 |
|
3151 |
| - // \ref{array.tuple}, tuple interface to class template \tcode{array} |
| 3151 | + // \ref{array.creation}, array creation functions |
| 3152 | + template<class T, size_t N> |
| 3153 | + constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]); |
| 3154 | + template<class T, size_t N> |
| 3155 | + constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]); |
| 3156 | + |
| 3157 | + // \ref{array.tuple}, tuple interface |
3152 | 3158 | template<class T> struct tuple_size;
|
3153 | 3159 | template<size_t I, class T> struct tuple_element;
|
3154 | 3160 | template<class T, size_t N>
|
|
3520 | 3526 | Member function \tcode{swap()} shall have a
|
3521 | 3527 | non-throwing exception specification.
|
3522 | 3528 |
|
| 3529 | +\rSec3[array.creation]{Array creation functions} |
| 3530 | +\indextext{\idxcode{array}!creation}% |
| 3531 | + |
| 3532 | +\indexlibrary{\idxcode{to_array}}% |
| 3533 | +\begin{itemdecl} |
| 3534 | +template<class T, size_t N> |
| 3535 | + constexpr array<remove_cv_t<T>, N> to_array(T (&a)[N]); |
| 3536 | +\end{itemdecl} |
| 3537 | + |
| 3538 | +\begin{itemdescr} |
| 3539 | +\pnum |
| 3540 | +\mandates |
| 3541 | +\tcode{is_array_v<T>} is \tcode{false} and |
| 3542 | +\tcode{is_constructible_v<T, T\&>} is \tcode{true}. |
| 3543 | + |
| 3544 | +\pnum |
| 3545 | +\expects |
| 3546 | +\tcode{T} meets the \oldconcept{CopyConstructible} requirements. |
| 3547 | + |
| 3548 | +\pnum |
| 3549 | +\returns \tcode{\{\{ a[0], $\dotsc$, a[N - 1] \}\}}. |
| 3550 | +\end{itemdescr} |
| 3551 | + |
| 3552 | +\indexlibrary{\idxcode{to_array}}% |
| 3553 | +\begin{itemdecl} |
| 3554 | +template<class T, size_t N> |
| 3555 | + constexpr array<remove_cv_t<T>, N> to_array(T (&&a)[N]); |
| 3556 | +\end{itemdecl} |
| 3557 | + |
| 3558 | +\begin{itemdescr} |
| 3559 | +\pnum |
| 3560 | +\mandates |
| 3561 | +\tcode{is_array_v<T>} is \tcode{false} and |
| 3562 | +\tcode{is_move_constructible_v<T>} is \tcode{true}. |
| 3563 | + |
| 3564 | +\pnum |
| 3565 | +\expects |
| 3566 | +\tcode{T} meets the \oldconcept{MoveConstructible} requirements. |
| 3567 | + |
| 3568 | +\pnum |
| 3569 | +\returns \tcode{\{\{ std::move(a[0]), $\dotsc$, std::move(a[N - 1]) \}\}}. |
| 3570 | +\end{itemdescr} |
| 3571 | + |
3523 | 3572 | \rSec3[array.tuple]{Tuple interface}
|
3524 | 3573 | \indexlibrary{\idxcode{array}}%
|
3525 | 3574 | \indexlibrary{\idxcode{tuple}}%
|
|
0 commit comments