Skip to content

cannot iterate over const chain object. #65

Closed

Description

@ryanhaining

The following fails, can't construct the iterator

#include <vector>

#include "cppitertools/chain.hpp"

int main() {
  std::vector<char> v1 = {'a'};
  std::vector<char> v2 = {'b'};
  const auto ch = iter::chain(v1, v2);
  std::begin(ch);
}

Because the chain begin() const is saying that the iterator needs a const tuple<Ts...> while what it actually gets is tuple<const Ts...>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions