The CKey::Set()
template function handles std::byte
just fine: https://github.com/bitcoin/bitcoin/blob/b5d21182e5a66110ce2796c2c99da39c8ebf0d72/src/key.h#L105
Noticed in #29774 (review).
UCharCast
calls
#29820
The CKey::Set()
template function handles std::byte
just fine: https://github.com/bitcoin/bitcoin/blob/b5d21182e5a66110ce2796c2c99da39c8ebf0d72/src/key.h#L105
Noticed in #29774 (review).
The `CKey::Set()` template function handles `std::byte` just fine.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For detailed information about the code coverage, see the test coverage report.
See the guideline for information on the review process.
Type | Reviewers |
---|---|
ACK | maflcko, laanwj, hernanmarino |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
No conflicts as of last run.
lgtm ACK 56e1e5dd10cbe51d3abc3fbf532b6b41bf62a889
A (more invasive) alternative would be to use Set(Span<std::byte>)
, or Set(Span<BasicByte>)
Just for reference, the reason this is safe, is not because of the line linked to in the pull request description, but due to the existing UCharCast
in the function. Error when trying to pass the wrong type:
0./key.h:103:26: error: no matching function for call to 'UCharCast'
1 103 | } else if (Check(UCharCast(&pbegin[0]))) {
2 | ^~~~~~~~~
3note: in instantiation of function template specialization 'CKey::Set<__gnu_cxx::__normal_iterator<int *, std::vector<int>>>' requested here