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

compilation errors with view::sliding #975

Closed
amidvidy opened this issue Dec 30, 2018 · 1 comment
Closed

compilation errors with view::sliding #975

amidvidy opened this issue Dec 30, 2018 · 1 comment
Labels

Comments

@amidvidy
Copy link

amidvidy commented Dec 30, 2018

I get compilation errors when trying to use view::sliding over a view created with view::group_by

Compiler: g++ 8.2.0, --std=c++17

Code:

#include <iostream>
#include <string>
#include <vector>

#include <range/v3/all.hpp>

int main() {
  std::vector<double> v{2.0, 2.0, 3.0, 1.0};
  std::vector<int> i{1, 2, 1, 2};
  std::vector<int> t{1, 1, 2, 2};
  {
    using namespace ranges;
    auto vals = view::zip(v, i, t);
    auto g = view::group_by(
        vals, [](auto&& t1, auto&& t2) { return std::get<2>(t1) == std::get<2>(t2); });

    auto windows = view::sliding(g, 2);
    auto it = std::begin(windows);
  }
}
ericniebler added a commit that referenced this issue Dec 31, 2018
const-correctness bug in view::sliding; fixes #975
@amidvidy
Copy link
Author

amidvidy commented Jan 2, 2019

thanks!

@ericniebler ericniebler added the bug label Jan 7, 2019
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