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::join functionality question #278

Open
melton1968 opened this issue Feb 15, 2019 · 0 comments
Open

view::join functionality question #278

melton1968 opened this issue Feb 15, 2019 · 0 comments

Comments

@melton1968
Copy link

This code compiles fine:

    {
        auto strs = { "1", "2", "3", "4", "5" };
        auto g0 = strs
            | v::join;
    }

This code does not:

    {
        strings strs = { "1", "2", "3", "4", "5" };
        auto g0 = strs
            | v::transform([](auto v) { return v; })
            | v::join;
    }

Simplifying for better compiler diagnostics:

    {
        strings strs = { "1", "2", "3", "4", "5" };
        auto g0 = strs
            | v::transform([](auto v) { return v; });
        auto g1 = r::join_view{ g0 };
    }

The compiler take umbrage here (join.hpp:58)

requires View<V> && InputRange<iter_reference_t<iterator_t<V>>> &&
                (detail::_GLvalueRange<V> || View<iter_value_t<iterator_t<V>>>) // TODO: file LWG i\
ssue

This complaint is twofold:

  1. the underlying Range doesn't return a reference from operator* (make sense for transform).
  2. the underlying iterator value type (string) is not a View.

Is this the expected behavior?
Know issue?

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

No branches or pull requests

1 participant