Idea: scope_exit #2874
Closed
pfeatherstone
started this conversation in
Ideas
Replies: 2 comments
-
Nice, yeah, would be cool to have this kind of thing on hand. Have this tool at work and it's useful :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Added #2875 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This might be a nice PR:
https://godbolt.org/z/zocG4ejhs
The non-erased version is a lot better but there are use-cases for the erased version.
Also note, the erased version is slightly more efficient than using
std::shared_ptr<void>
with a custom deleter which calls exit function.Beta Was this translation helpful? Give feedback.
All reactions