libstdc++: subrange converting constructor should disallow slicing (LWG 3282)
authorJonathan Wakely <jwakely@redhat.com>
Wed, 19 Feb 2020 17:04:07 +0000 (17:04 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 19 Feb 2020 21:21:06 +0000 (21:21 +0000)
commit77f5310f0205714538668b88fbf1de44f1f435be
tree36dc532e0fe7a20db16d3a553ba6881b19312053
parent59aa9e577eb2b182374f5421828687c93b81ad3d
libstdc++: subrange converting constructor should disallow slicing (LWG 3282)

* include/std/ranges (__detail::__convertible_to_non_slicing): New
helper concept.
(__detail::__pair_like_convertible_to): Remove.
(__detail::__pair_like_convertible_from): Add requirements for
non-slicing conversions.
(subrange): Constrain constructors with __convertible_to_non_slicing.
Remove constructors from pair-like types. Add new deduction guide.
* testsuite/std/ranges/subrange/lwg3282_neg.cc: New test.
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/subrange/lwg3282_neg.cc [new file with mode: 0644]