Hi, Following issue: #22289 It's completely overkill, even though it's just a comment. But it's what it'll take for me to sleep tonight. I've only added a comment to clarrify that this constructor comes with a narrow contract.
Added comment about narrow contract for Span(T* begin, T* end) ctor #22291
pull ViralTaco wants to merge 1 commits into bitcoin:master from ViralTaco:master changing 1 files +2 −0-
ViralTaco commented at 4:00 PM on June 20, 2021: none
-
Added comment about narrow contract for Span(T* begin, T* end) constructor 39cb974407
- fanquake added the label Docs on Jun 21, 2021
-
laanwj commented at 6:36 PM on September 16, 2021: member
~0 ACK 39cb974407ef749b2a65c60ffc1178e83b3feb53 This comment is correct, however I don't know what else one would expect when passing an invalid range into this function.
-
ViralTaco commented at 4:27 PM on October 19, 2021: none
I don't know what else one would expect when passing an invalid range into this function.
Defined behavior?
-
MarcoFalke commented at 7:44 AM on October 20, 2021: member
The docs say that this is UB, so why would anyone assume the opposite?
https://en.cppreference.com/w/cpp/container/span/span
The behavior is undefined if [first, first + count) is not a valid range, if It does not actually model contiguous_iterator, or if extent != std::dynamic_extent && count != extent.
-
ViralTaco commented at 3:09 AM on October 24, 2021: none
The docs say that this is UB, so why would anyone assume the opposite?
https://en.cppreference.com/w/cpp/container/span/span
The behavior is undefined if [first, first + count) is not a valid range, if It does not actually model contiguous_iterator, or if extent != std::dynamic_extent && count != extent.
Following issue: #22289
- fanquake closed this on Mar 24, 2022
- DrahtBot locked this on Mar 24, 2023