Edit: My confusion came from not understanding the explicit
specifier and contextual conversions to bool
In v19.35 you could pass an invocable to ranges::views::filter
that returned std::optional
. In v19.36 you cant:
https://godbolt.org/z/jcfjE3var
auto input = std::vector<std::optional<int>>{};
#if 1
// broken v19.36, works prior
input | ranges::views::filter([](auto pair) -> std::optional<int> { return pair; });
#else
// works
input | ranges::views::filter([](auto pair) -> bool { return pair; });
#endif
Anyone know why?