Skip to content

compilation errors with view::sliding  #975

@amidvidy

Description

@amidvidy

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);
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions