mirror of
https://github.com/boostorg/array.git
synced 2025-07-30 04:37:21 +02:00
Update documentation
This commit is contained in:
@ -21,3 +21,4 @@ http://www.boost.org/LICENSE_1_0.txt
|
|||||||
* Removed local `hash_value` overload; `boost::hash` supports array-like types natively.
|
* Removed local `hash_value` overload; `boost::hash` supports array-like types natively.
|
||||||
* `array<T, 0>` can now be initialized with `= {{}}`.
|
* `array<T, 0>` can now be initialized with `= {{}}`.
|
||||||
* Added `operator\<\=>`.
|
* Added `operator\<\=>`.
|
||||||
|
* Added `to_array`.
|
||||||
|
@ -42,6 +42,13 @@ namespace boost {
|
|||||||
constexpr T& get(array<T, N>&) noexcept;
|
constexpr T& get(array<T, N>&) noexcept;
|
||||||
template<std::size_t Idx, typename T, std::size_t N>
|
template<std::size_t Idx, typename T, std::size_t N>
|
||||||
constexpr const T& get(const array<T, N>&) noexcept;
|
constexpr const T& get(const array<T, N>&) noexcept;
|
||||||
|
|
||||||
|
template<class T, std::size_t N>
|
||||||
|
constexpr array<T, N> to_array( T const (&)[N] );
|
||||||
|
template<class T, std::size_t N>
|
||||||
|
constexpr array<T, N> to_array( T (&&)[N] );
|
||||||
|
template<class T, std::size_t N>
|
||||||
|
constexpr array<T, N> to_array( T const (&&)[N] );
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -417,3 +424,29 @@ Mandates: :: `Idx < N`.
|
|||||||
Returns: :: `arr[Idx]`.
|
Returns: :: `arr[Idx]`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
### Creation
|
||||||
|
|
||||||
|
```
|
||||||
|
template<class T, std::size_t N>
|
||||||
|
constexpr array<T, N> to_array( T const (&a)[N] );
|
||||||
|
```
|
||||||
|
[horizontal]
|
||||||
|
Returns: :: an `array<T, N>` `r` such that for each `i` in `[0..N)`, `r[i]` is copied from `a[i]`.
|
||||||
|
|
||||||
|
```
|
||||||
|
template<class T, std::size_t N>
|
||||||
|
constexpr array<T, N> to_array( T (&&a)[N] );
|
||||||
|
```
|
||||||
|
[horizontal]
|
||||||
|
Returns: :: an `array<T, N>` `r` such that for each `i` in `[0..N)`, `r[i]` is moved from `std::move(a[i])`.
|
||||||
|
|
||||||
|
```
|
||||||
|
template<class T, std::size_t N>
|
||||||
|
constexpr array<T, N> to_array( T const (&&a)[N] );
|
||||||
|
```
|
||||||
|
[horizontal]
|
||||||
|
Returns: :: an `array<T, N>` `r` such that for each `i` in `[0..N)`, `r[i]` is copied from `a[i]`.
|
||||||
|
|
||||||
|
---
|
||||||
|
Reference in New Issue
Block a user