arximboldi / immer

Postmodern immutable and persistent data structures for C++ — value semantics at scale
https://sinusoid.es/immer
Boost Software License 1.0
2.48k stars 177 forks source link

immer::map can no longer be used with std::views/std::ranges #240

Closed jon-smith closed 11 months ago

jon-smith commented 1 year ago

I noticed since champ_iterator() = default; was removed, immer::map no longer satisfies the constraint std::ranges::range, which prevents usage with views, e.g. for(const auto &v : map | std::views::values).

The issue is with std::ranges::end(), but oddly, std::end() compiles fine. I'm not sure if this is a difference in the standard or a compiler issue.

For reference, I'm compiling on MSVC v19.34.31935 (latest version at present time).

I'm happy to submit a PR to reintroduce the default constructor but wanted to check if this is wanted/the right way to go about it.

arximboldi commented 1 year ago

It would be nice to have it, for sure. I'm happy for a PR to reintroduce it. Not sure now how and why it was removed.

jon-smith commented 11 months ago

Fixed by #257