range-v3
range-v3 copied to clipboard
Why does std::filesystem::directory_iterator not satisfy borrowed_range concept like std::basic_string_view?
I've started playing with with ranges and C++20 and came to the similar problem as in #1400 But I did:
namespace ranges
{
template <>
inline constexpr bool enable_borrowed_range<std::filesystem::directory_iterator> = true;
}
Which allows me to write and compile code like this: (gcc 10.2, Linux):
fs::directory_iterator{"/home"} |
views::filter([](fs::directory_entry const& e) {
return e.is_directory();
});
Why this is not enabled by default?
Maybe related https://cplusplus.github.io/LWG/issue3480.
@BRevzin Sorry that I ping you, but what are your thoughts on this?