On October 15, 2023 8:17:10 PM Peter Dimov via Boost
Andrey Semashev wrote: ...
Source:
https://github.com/Lastique/scope
Docs:
https://lastique.github.io/scope/libs/scope/doc/html/index.html ... I have now merged scope_check into scope_exit, as you suggested. There is already a lightweight scope_final guard, so making scope_exit more feature-rich seemed like a good idea. Thanks for the suggestion.
In principle, the implementation can specialize scope_exit for the default case of always_true, so it doesn't have to be any less efficient than before.
Yes, I thought so too. I even had the idea of making void the default and specialize for that. But the current implementation should be efficient as well, although it requires more template machinery to eliminate the runtime overhead. It might affect compile times though.