-
Notifications
You must be signed in to change notification settings - Fork 1.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
<ranges>
: views::counted::_Choose()
misses difference casting for contiguous_iterator
case
#5183
Comments
Looks like that we can just use |
|
Lines 4224 to 4227 in 89ca073
In addition, |
|
Sorry, what I meant here is that if |
I see! Yes, |
I thing there're weird iterator types indicating that we should use #include <ranges>
struct I {
using difference_type = int;
I() = default;
I(I&&) = default;
I& operator=(I&&) = default;
explicit I(const I&) = delete;
template<int = 0>
I(const I&);
int operator*();
I& operator++();
void operator++(int);
};
int main() {
I it;
(void) std::views::counted(it, 5); // currently rejected
(void) std::counted_iterator(it, 5); // currently OK
} Moreover, it's a bit unfortrunate that |
STL/stl/inc/ranges
Lines 4214 to 4220 in 89ca073
The second difference argument passed into
span
misses thesize_t
casting, which would cause a hard error if it is not implicitly-convertible tosize_t
.testcase:
https://godbolt.org/z/e1hv1o6h8
This can be a good first issue.
The text was updated successfully, but these errors were encountered: