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

view::linear_distribute should be marked single pass #1088

Closed
dvirtz opened this issue Mar 15, 2019 · 0 comments
Closed

view::linear_distribute should be marked single pass #1088

dvirtz opened this issue Mar 15, 2019 · 0 comments
Labels

Comments

@dvirtz
Copy link
Contributor

dvirtz commented Mar 15, 2019

The following code fails on an assertion and should fail to compile:

auto ld = view::linear_distribute(1, 10, 10);
auto i = next(ld.begin(), 4);
distance(ld.begin(), i);

output is

prog.exe: /opt/wandbox/range-v3/include/range/v3/view/linear_distribute.hpp:55: 
bool ranges::v3::view::linear_distribute_view<int>::equal(const linear_distribute_view<T> &) const [T = int]: 
Assertion `from_ == other.from_ && to_ == other.to_' failed.

https://wandbox.org/permlink/71k8ETkWzTkWrIW4

@dvirtz dvirtz changed the title linear_distribution should be marked single pass view::linear_distribute should be marked single pass Mar 15, 2019
CaseyCarter added a commit to CaseyCarter/range-v3 that referenced this issue Mar 15, 2019
The `from_` values are only equal if the `n_` values are.

Fixes ericniebler#1088.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants