Extend docs and tests for span ctor (#1096)

This commit is contained in:
Werner Henze
2023-02-22 00:46:40 +01:00
committed by GitHub
parent 9851b94d7e
commit 7a297d4283
2 changed files with 10 additions and 0 deletions

View File

@ -485,6 +485,9 @@ constexpr span(const span<OtherElementType, OtherExtent>& other) noexcept;
Constructs a `span` from another `span`. This constructor is available if `OtherExtent == Extent || Extent ==`[`gsl::dynamic_extent`](#user-content-H-span_ext-dynamic_extent)` || OtherExtent ==`[`gsl::dynamic_extent`](#user-content-H-span_ext-dynamic_extent)
and if `ElementType` and `OtherElementType` are compatible.
If `Extent !=`[`gsl::dynamic_extent`](#user-content-H-span_ext-dynamic_extent) and `OtherExtent ==`[`gsl::dynamic_extent`](#user-content-H-span_ext-dynamic_extent),
then the constructor [`Expects`](#user-content-H-assert-expects) that `other.size() == Extent`.
```cpp
constexpr span& operator=(const span& other) noexcept = default;
```