Am 03.07.2024 um 00:16 schrieb Chris M. Thomasson:
On 7/2/2024 2:44 AM, Bonita Montero wrote:
For some time I use sth. like experimental::scope_exit, but sth.[...]
more advanced. My class is called invoke_on_destruct and multiple
of these scope-guards can be concatenated. So if you have multiple
data struc- tures which are changed you can revert all changes with
multiple individual scope-guards.
After you changed everything you do sth. like a commit by disabling
the last scope-guard. The enabled state is propagated on destruction
to the depending scope-guards so you only have to disable the last
and all depening scope-guards are disabled also.
It actually does remind me of the original scope guard in a sense.
What's the "original" scope guard ?
The only semi-official version is experimental::scope_exit.
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (3 / 13) |
| Uptime: | 158:05:24 |
| Calls: | 12,094 |
| Calls today: | 2 |
| Files: | 15,000 |
| Messages: | 6,517,755 |