cmcstl2
cmcstl2 copied to clipboard
view::join functionality question
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:
- the underlying Range doesn't return a reference from operator* (make sense for transform).
- the underlying iterator value type (string) is not a View.
Is this the expected behavior? Know issue?