mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Merge remote-tracking branch 'origin/topic/timw/move-util-deferred'
* origin/topic/timw/move-util-deferred: Move util::Deferred into util-types.h
This commit is contained in:
commit
448590270b
4 changed files with 17 additions and 13 deletions
4
CHANGES
4
CHANGES
|
@ -1,3 +1,7 @@
|
|||
8.0.0-dev.646 | 2025-07-13 19:22:52 -0700
|
||||
|
||||
* Move util::Deferred into util-types.h (Tim Wojtulewicz, Corelight)
|
||||
|
||||
8.0.0-dev.643 | 2025-07-11 15:35:33 -0400
|
||||
|
||||
* Cleanup unused baselines (Evan Typanski, Corelight)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
8.0.0-dev.643
|
||||
8.0.0-dev.646
|
||||
|
|
|
@ -62,5 +62,17 @@ private:
|
|||
void DoFunc(const std::string& path, bool error_aborts = true);
|
||||
};
|
||||
|
||||
/**
|
||||
* Helper class that runs a function at destruction.
|
||||
*/
|
||||
class Deferred {
|
||||
public:
|
||||
Deferred(std::function<void()> deferred) : deferred(std::move(deferred)) {}
|
||||
~Deferred() { deferred(); }
|
||||
|
||||
private:
|
||||
std::function<void()> deferred;
|
||||
};
|
||||
|
||||
} // namespace util
|
||||
} // namespace zeek
|
||||
|
|
12
src/util.h
12
src/util.h
|
@ -622,17 +622,5 @@ inline std::vector<std::wstring_view> split(const wchar_t* s, const wchar_t* del
|
|||
return split(std::wstring_view(s), std::wstring_view(delim));
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper class that runs a function at destruction.
|
||||
*/
|
||||
class Deferred {
|
||||
public:
|
||||
Deferred(std::function<void()> deferred) : deferred(std::move(deferred)) {}
|
||||
~Deferred() { deferred(); }
|
||||
|
||||
private:
|
||||
std::function<void()> deferred;
|
||||
};
|
||||
|
||||
} // namespace util
|
||||
} // namespace zeek
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue