Implement LWG 3255 for std::span constructors
commit582c57a17eaf02e90492145cd7217bda5499076b
authorJonathan Wakely <jwakely@redhat.com>
Mon, 30 Sep 2019 11:52:08 +0000 (30 12:52 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 30 Sep 2019 11:52:08 +0000 (30 12:52 +0100)
tree2c75c44849d88b4261c0cf454cf0118a4534976e
parent6438d29fb1a31c95b9d652117a79dde2f9e4ad6f
Implement LWG 3255 for std::span constructors

Also fix the constraints on span(Container&) and span(const Container&)
constructors so that they aren't used for const spans or const arrays.

* include/std/span (span(element_type(&)[N]))
(span(array<value_type, N>&), span(const array<value_type, N>&)):
Deduce array element type to allow safe const conversions (LWG 3255).
[!_GLIBCXX_P1394] (span(Container&), span(const Container&)): Use
remove_cv_t on arguments to __is_std_span and __is_std_array.
* testsuite/23_containers/span/lwg3255.cc: New test.

From-SVN: r276298
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/span
libstdc++-v3/testsuite/23_containers/span/lwg3255.cc [new file with mode: 0644]