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

cannot iterate over const chain object. #65

Closed
ryanhaining opened this issue Dec 23, 2019 · 0 comments
Closed

cannot iterate over const chain object. #65

ryanhaining opened this issue Dec 23, 2019 · 0 comments
Labels

Comments

@ryanhaining
Copy link
Owner

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
Labels
Projects
None yet
Development

No branches or pull requests

1 participant