[SG16-Unicode] [isocpp-lib-ext] Proposed design change to P1030 filesystem::path_view

David Stone david.stone at uber.com
Mon Aug 26 23:32:32 CEST 2019


I have several times written (and seen written) code like

    auto directory = std::filesystem::path(...);
    for (auto const & path : directory) {
        use(path);
    }

when what I meant was

    auto directory = std::filesystem::path(...);
    for (auto path_it = std::filesystem::directory_iterator(directory);
path_it != std::filesystem::directory_iterator(); ++path_it) {
        use(*path_it);
    }

but I have never intentionally iterated over the components of the path
(and if I did, I would expect to need to apply some transformation to get
that).

I have to agree with Arthur that this is a big source of errors in the
existing API and should not be used as a precedent if at all possible.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.open-std.org/pipermail/unicode/attachments/20190826/d172cf3f/attachment.html 


More information about the Unicode mailing list