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
  1. ViralTaco commented at 4:00 PM on June 20, 2021: none

    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.

  2. Added comment about narrow contract for Span(T* begin, T* end) constructor 39cb974407
  3. fanquake added the label Docs on Jun 21, 2021
  4. 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.

  5. 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?

  6. 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.

  7. 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

  8. fanquake commented at 3:32 PM on March 24, 2022: member

    Going to close this for now, given #22289 is also closed.

  9. fanquake closed this on Mar 24, 2022

  10. DrahtBot locked this on Mar 24, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me