libstdc++: P1976R2 Fixed-size span construction from dynamic range
authorJonathan Wakely <jwakely@redhat.com>
Tue, 18 Feb 2020 15:51:27 +0000 (15:51 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 18 Feb 2020 17:43:36 +0000 (17:43 +0000)
commit9b8e2dea783b3e67813b12c7cb3036b5a9892c65
tree47744e82b548bf1f4bcc08509b58ce03a097c0a9
parentd6c9e372372ee78283a21651313fce965d22274d
libstdc++: P1976R2 Fixed-size span construction from dynamic range

This includes fixes for first, last, as_bytes and as_writable_bytes
which were missing from the paper.

* include/std/span (__cpp_lib_span): Update value.
(span(It, size_type), span(It, End)): Make conditionally explicit. Add
assertion.
(span(R&&), span(const span<OType, OExtent>&)): Likewise and relax
constraints.
(span::first<Count>(), span::last<Count>()): Use explicit type in
return statement.
(as_bytes, as_writable_bytes): Likewise.
* include/std/version (__cpp_lib_span): Update value.
* testsuite/23_containers/span/1.cc: Check new value.
* testsuite/23_containers/span/2.cc: Check new value.
* testsuite/23_containers/span/explicit.cc: New test.
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/span
libstdc++-v3/include/std/version
libstdc++-v3/testsuite/23_containers/span/1.cc
libstdc++-v3/testsuite/23_containers/span/2.cc
libstdc++-v3/testsuite/23_containers/span/explicit.cc [new file with mode: 0644]