Skip to content

Commit eee0d5b

Browse files
committed
Update documentation
1 parent ec61272 commit eee0d5b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

doc/array/changes.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ http://www.boost.org/LICENSE_1_0.txt
2121
* Removed local `hash_value` overload; `boost::hash` supports array-like types natively.
2222
* `array<T, 0>` can now be initialized with `= {{}}`.
2323
* Added `operator\<\=>`.
24+
* Added `to_array`.

doc/array/reference.adoc

+33
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ namespace boost {
4242
constexpr T& get(array<T, N>&) noexcept;
4343
template<std::size_t Idx, typename T, std::size_t N>
4444
constexpr const T& get(const array<T, N>&) noexcept;
45+
46+
template<class T, std::size_t N>
47+
constexpr array<T, N> to_array( T const (&)[N] );
48+
template<class T, std::size_t N>
49+
constexpr array<T, N> to_array( T (&&)[N] );
50+
template<class T, std::size_t N>
51+
constexpr array<T, N> to_array( T const (&&)[N] );
4552
}
4653
```
4754

@@ -417,3 +424,29 @@ Mandates: :: `Idx < N`.
417424
Returns: :: `arr[Idx]`.
418425

419426
---
427+
428+
429+
### Creation
430+
431+
```
432+
template<class T, std::size_t N>
433+
constexpr array<T, N> to_array( T const (&a)[N] );
434+
```
435+
[horizontal]
436+
Returns: :: an `array<T, N>` `r` such that for each `i` in `[0..N)`, `r[i]` is copied from `a[i]`.
437+
438+
```
439+
template<class T, std::size_t N>
440+
constexpr array<T, N> to_array( T (&&a)[N] );
441+
```
442+
[horizontal]
443+
Returns: :: an `array<T, N>` `r` such that for each `i` in `[0..N)`, `r[i]` is moved from `std::move(a[i])`.
444+
445+
```
446+
template<class T, std::size_t N>
447+
constexpr array<T, N> to_array( T const (&&a)[N] );
448+
```
449+
[horizontal]
450+
Returns: :: an `array<T, N>` `r` such that for each `i` in `[0..N)`, `r[i]` is copied from `a[i]`.
451+
452+
---

0 commit comments

Comments
 (0)