Closed beinhaerter closed 1 year ago
As the reviews seems to take some time, I have now completed the docs.
@beinhaerter I left one last comment - after this it should be good to merge. thanks for being patient!
If I assembled it correctly, then your proposed change is:
template <class OtherElementType, std::size_t OtherExtent> explicit(Extent == gsl::dynamic_extent || Extent == OtherExtent) constexpr span(const span<OtherElementType, OtherExtent>& other) noexcept; template <class OtherElementType, std::size_t OtherExtent> explicit(Extent != gsl::dynamic_extent && OtherExtent == Extent) constexpr explicit span(const span<OtherElementType, OtherExtent>& other) noexcept;
Constructs a
span
from anotherspan
, allowing construction from aspan
of different extent and element type.
This is not correct. The first ctor is not explicit
. The second ctor is always explicit
, so the line with only the explicit
should be removed.
The new comment does not mention that there are constraints for ElementType
and OtherElementType
.
The new comment does not mention that you cannot construct a gsl::span<T, 3>
from a gsl::span<T, something_other_than_3>
.
But I now see that my comments for the enablement were also false. The second enable_if
slightly differs from the first one.
Thanks for the PR, looks good!
This is a first (partial) shot for issue #1071.