-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
std::views::join on beman::optional26::optional doesn't work in constexpr context in my code https://godbolt.org/z/Ed11G66s3 (switch preprocessor if 1 to see error)
This code doesn't work in constexpr:
auto range_result = view_of_optionals | std::views::join | std::views::take(100);I expected it work like this C++23 code:
auto range_result = view_of_optionals
| std::views::filter([](const optional26<int>& opt) { return opt.has_value(); })
| std::views::transform([](const optional26<int>& opt) { return *opt; })
| std::views::take(100);Filtering out all nullopt from view
With std::views::join compiler gives error that contiguous_iterator is not constexpr, so I simply tried editing it's declaration - marking everything I could as constexpr and afterwards this code worked as expected. So solely based on this I think it should be constexpr.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels