public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/106201] New: filesystem::directory_iterator is a borrowable range?
@ 2022-07-05 13:28 prlw1 at cam dot ac.uk
  2022-07-05 14:11 ` [Bug libstdc++/106201] " redi at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: prlw1 at cam dot ac.uk @ 2022-07-05 13:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106201

            Bug ID: 106201
           Summary: filesystem::directory_iterator is a borrowable range?
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: prlw1 at cam dot ac.uk
  Target Milestone: ---

In the following:

#include <algorithm>
#include <filesystem>
#include <iostream>
#include <ranges>

int main()
{
        auto print = [](const auto& x) {std::cout << x << '\n';} ;

        std::ranges::for_each(
                std::views::iota(1) | std::views::take(5),
                print
        );

        std::ranges::for_each(
                std::filesystem::directory_iterator("/"),
                print
        );

        std::ranges::for_each(
                std::filesystem::directory_iterator("/") | std::views::take(3),
                print
        );      
}

the first two for_each clauses compile and execute correctly, even with g++
10.3.0.

Is my expectation that the third clause is valid incorrect?

(I just tried with today's head, g++ (GCC) 13.0.0 20220705 (experimental) and
it failed to compile.)

Oh: https://cplusplus.github.io/LWG/issue3480
But: it says "could be fixed ... (as libstdc++ currently does anyway)"
Issue looks resolved?
Thoughts?

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-03-08 21:47 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-05 13:28 [Bug libstdc++/106201] New: filesystem::directory_iterator is a borrowable range? prlw1 at cam dot ac.uk
2022-07-05 14:11 ` [Bug libstdc++/106201] " redi at gcc dot gnu.org
2022-07-05 15:23 ` redi at gcc dot gnu.org
2022-07-05 15:31 ` redi at gcc dot gnu.org
2022-07-05 15:59 ` redi at gcc dot gnu.org
2022-07-19 18:05 ` cvs-commit at gcc dot gnu.org
2022-07-21 14:51 ` prlw1 at cam dot ac.uk
2022-07-21 14:52 ` redi at gcc dot gnu.org
2022-07-21 14:54 ` redi at gcc dot gnu.org
2022-07-21 14:59 ` prlw1 at cam dot ac.uk
2022-11-22 12:33 ` redi at gcc dot gnu.org
2022-11-22 17:54 ` cvs-commit at gcc dot gnu.org
2022-11-22 21:49 ` cvs-commit at gcc dot gnu.org
2022-11-25  0:21 ` cvs-commit at gcc dot gnu.org
2023-10-04  9:18 ` redi at gcc dot gnu.org
2024-03-08 21:47 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).