Fixed crash on enumerate + rvalue

This commit is contained in:
catalinvasile
2024-07-11 17:57:31 +02:00
parent 28b74b4056
commit 5ec1fddf57
10 changed files with 30 additions and 34 deletions
+6 -2
View File
@@ -117,8 +117,12 @@ public:
virtual SetWriteTimeResult setWriteTime(AbsPathView path, time_t time) = 0;
virtual cppcoro::generator<EnumerateEntry> enumerate(AbsPathView path) const = 0;
virtual cppcoro::generator<EnumerateEntry> enumerateRecursively(AbsPathView path) const = 0;
//The AbsPath is a copy, because there are lifetime subtleties when using coroutines.
//In particular, without pass-by-value, this would crash because nobody is storing the rvalue:
// for (auto e: fs.enumerate(path + "other folder"))
// {}
virtual cppcoro::generator<EnumerateEntry> enumerate(AbsPath path) const = 0;
virtual cppcoro::generator<EnumerateEntry> enumerateRecursively(AbsPath path) const = 0;
};