Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Span sources updates, up-to-date with current upstream. #2470

Merged
merged 15 commits into from
Jul 21, 2021

Conversation

furszy
Copy link

@furszy furszy commented Jul 6, 2021

Another decouple from #2411.
Purely focused on updating the Span sources to be up-to-date with current upstream.

Following PRs/commits were back ported:

Extra side note:
Some of the current serialization compiler warnings in master will be fixed with this, other ones are coming down 2411 commits line as they need other previous PRs.

@furszy furszy self-assigned this Jul 6, 2021
@furszy furszy added this to the 6.0.0 milestone Jul 6, 2021
@furszy furszy added the Upstream label Jul 6, 2021
sipa and others added 15 commits July 6, 2021 20:59
This introduces a rudimentary begin(), end(), operator[], and subspan to Span.
from btc@2b0fcff7f26d59fed4bcafd1602325122a206c67
This matches a change in the C++20 std::span proposal.
This prevents constructing a Span<A> given two pointers into an array
of B (where B is a subclass of A), at least without explicit cast to
pointers to A.
c++20's draft of std::span no longer includes move constructors.
See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0936r0.pdf for
reference.

This helps to guard against dangling references caused by construction from
temporaries such as:

    Span<const int> sp(std::vector<int>{1,2,3});
Co-authored-by: practicalswift <practicalswift@users.noreply.github.com>
Adapted from btc@e2aa1a585a83971639572cd2c84565ec360deac9
Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK a1f3aed

@random-zebra random-zebra added this to In Progress in perpetual updating PIVX Core to BTC Core via automation Jul 17, 2021
@furszy furszy assigned Fuzzbawls and unassigned Fuzzbawls Jul 18, 2021
@furszy furszy requested a review from Fuzzbawls July 19, 2021 11:21
@random-zebra random-zebra merged commit 56f10aa into PIVX-Project:master Jul 21, 2021
perpetual updating PIVX Core to BTC Core automation moved this from In Progress to Done Jul 21, 2021
random-zebra added a commit that referenced this pull request Aug 16, 2021
d4408cd Make HexStr() take a Span (furszy)
4c755ec dead code: Remove dead option in HexStr conversion. (Lenny Maiorani)

Pull request description:

  Follow up to #2470. Only the last two commits are from this work.

  Make `HexStr` take a span of bytes, instead of an awkward pair of templated iterators. Simplifying most of the uses.

  Adaptation of bitcoin#19660 and bitcoin#15573.

ACKs for top commit:
  random-zebra:
    utACK d4408cd

Tree-SHA512: 541f80e1af9abea2d662e5fc31fc4d5b4057ff93eefeba5632c6ddca391f3b148c8d819a56802720c3932c3c2afb69ddd1efb4890a59ecf1bf5afd6686cd5a67
@furszy furszy deleted the 2021_span_backports branch November 29, 2022 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants