Fixed crash on enumerate + rvalue
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user