From 047ba01807c38891355bf935b71878e3abe177cd Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 27 Jan 2025 17:16:50 +0200 Subject: [PATCH] Update documentation --- doc/array/reference.adoc | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/array/reference.adoc b/doc/array/reference.adoc index e2265de..114b27a 100644 --- a/doc/array/reference.adoc +++ b/doc/array/reference.adoc @@ -35,6 +35,9 @@ namespace boost { template constexpr bool operator>=(const array&, const array&); + template + constexpr auto operator<=>(const array&, const array&); + template constexpr T& get(array&) noexcept; template @@ -136,7 +139,7 @@ public: template array& operator=(const array& other); ``` [horizontal] -Effects: :: `std::copy(rhs.begin(), rhs.end(), begin())`. +Effects: :: For each `i` in `[0..N)`, performs `elems[i] = other.elems[i];`. --- @@ -233,7 +236,7 @@ constexpr const_reference operator[](size_type i) const; [horizontal] Requires: :: `i < N`. Returns: :: `elems[i]`. -Throws: :: nothing. +Throws: :: Nothing. --- @@ -254,7 +257,7 @@ constexpr const_reference front() const; [horizontal] Requires: :: `N > 0`. Returns: :: `elems[0]`. -Throws: :: nothing. +Throws: :: Nothing. --- @@ -265,7 +268,7 @@ constexpr const_reference back() const; [horizontal] Requires: :: `N > 0`. Returns: :: `elems[N-1]`. -Throws: :: nothing. +Throws: :: Nothing. --- @@ -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;`. --- @@ -382,6 +385,17 @@ Returns: :: `!(x < y)`. --- +``` +template + constexpr auto operator<=>(const array& x, const array& 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 ```