Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Jan 27, 2025
1 parent 45de3be commit 047ba01
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions doc/array/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ namespace boost {
template<typename T, std::size_t N>
constexpr bool operator>=(const array<T, N>&, const array<T, N>&);

template<typename T, std::size_t N>
constexpr auto operator<=>(const array<T, N>&, const array<T, N>&);

template<std::size_t Idx, typename T, std::size_t N>
constexpr T& get(array<T, N>&) noexcept;
template<std::size_t Idx, typename T, std::size_t N>
Expand Down Expand Up @@ -136,7 +139,7 @@ public:
template<typename U> array& operator=(const array<U, N>& other);
```
[horizontal]
Effects: :: `std::copy(rhs.begin(), rhs.end(), begin())`.
Effects: :: For each `i` in `[0..N)`, performs `elems[i] = other.elems[i];`.

---

Expand Down Expand Up @@ -233,7 +236,7 @@ constexpr const_reference operator[](size_type i) const;
[horizontal]
Requires: :: `i < N`.
Returns: :: `elems[i]`.
Throws: :: nothing.
Throws: :: Nothing.

---

Expand All @@ -254,7 +257,7 @@ constexpr const_reference front() const;
[horizontal]
Requires: :: `N > 0`.
Returns: :: `elems[0]`.
Throws: :: nothing.
Throws: :: Nothing.

---

Expand All @@ -265,7 +268,7 @@ constexpr const_reference back() const;
[horizontal]
Requires: :: `N > 0`.
Returns: :: `elems[N-1]`.
Throws: :: nothing.
Throws: :: Nothing.

---

Expand Down Expand Up @@ -302,7 +305,7 @@ Complexity: :: linear in `N`.
void fill(const T& value);
```
[horizontal]
Effects: :: for each `i` in `[0..N)`, performs `elems[i] = value;`.
Effects: :: For each `i` in `[0..N)`, performs `elems[i] = value;`.

---

Expand Down Expand Up @@ -382,6 +385,17 @@ Returns: :: `!(x < y)`.

---

```
template<typename T, std::size_t N>
constexpr auto operator<=>(const array<T, N>& x, const array<T, N>& y)
-> decltype(x[0] <=> y[0]);
```
[horizontal]
Effects: :: For each `i` in `[0..N)`, if `(x[i] \<\=> y[i]) != 0`, returns `x[i] \<\=> y[i]`. Otherwise, returns `std::strong_ordering::equal`, converted to the return type.
Remarks: :: When `N` is 0, the return type is `std::strong_ordering` and the return value is `std::strong_ordering::equal`.

---

### Specializations

```
Expand Down

0 comments on commit 047ba01

Please sign in to comment.