-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
refactor: Allow CScript construction from any std::input_iterator #29369
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
🚧 At least one of the CI tasks failed. Make sure to run all tests locally, according to the Possibly this is due to a silent merge conflict (the changes in this pull request being Leave a comment here, if you need help tracking down a confusing failure. |
Concept ACK dddd56c Looks like a nice code change to me. "previous releases" CI is turning up an issue in script/interpreter
|
looks like a few issues in that file |
@delta1 This is an issue in the C++ standard library. Basically, the standard assumes that |
@maflcko interesting, thanks for the context. does that mean that the previous releases CI job needs to be changed to use a newer gcc? |
Yes, either use a newer GCC, or remove the |
Also, remove the value_type alias, which is not needed when element_type is present.
dddd56c
to
fa9ef95
Compare
Removed unused |
ACK fa9ef95 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK fa9ef95
LGTM. Could change template<typename InputIterator>prevector(...)
to also expect std::input_iterator
.
The prevector functions that take two iterators first increase the capacity by last - first
then run fill(ptr, first, last)
-- that's buggy if the passed in iterators specify a greater range than a size_type
(or difference_type
for insert()
) can hold. Could perhaps be worth changing:
- template<typename InputIterator>
- void fill(T* dst, InputIterator first, InputIterator last) {
- while (first != last) {
+ template<std::input_iterator InputIterator>
+ void fill(T* dst, InputIterator first, size_type n) {
+ while (n-- > 0) {
Sure, done for all InputIterators in this file.
I think it will in all cases be buggy if the range can not be held in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK fa40ae2
Currently only (pre)vector iterators and raw pointers are accepted. However, this makes it harder to construct from input iterators provided by other classes, such as
std::span
.Fix that.