Lambdas acting as coroutines/generators: [file = ifstream(path)]() mutable -> optional<string> { while (file.good()) { string line; getline(file, line); return line; // return next line } return {}; }; It's a bit of a trick, but works.https://godbolt.org/z/zj99dK
-
-
I thought it was fun. Probably would have made a good lightning talk at a conference while you wait for the room to see what's going on. It's like a hand-wavy "look, I made a coroutine!" or something.
Kiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.