Pop-Up Thingie

>>> Magnum BBS <<<
  • Home
  • Forum
  • Files
  • Log in

  1. Forum
  2. Usenet
  3. COMP.LANG.C++
  • Re: like experimental::sope_exit, but more advanced

    From Paavo Helde@21:1/5 to Bonita Montero on Wed Jul 3 10:47:29 2024
    On 03.07.2024 01:59, Bonita Montero wrote:
    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.

    I guess Chris means ScopeGuard by Petru Marginean and Andrei Alexandrescu:

    "https://web.archive.org/web/20121009071337/http://www.drdobbs.com/cpp/generic-change-the-way-you-write-excepti/184403758"
    (page 1)

    "https://web.archive.org/web/20190317153736/http://www.drdobbs.com/cpp/generic-change-the-way-you-write-excepti/184403758?pgno=2"
    (page 2)

    "https://web.archive.org/web/20190317164052/http://www.drdobbs.com/cpp/generic-change-the-way-you-write-excepti/184403758?pgno=3"
    (page 3)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • Who's Online

  • Recent Visitors

    • Rixter
      Mon Nov 2 00:01:34 2026
      from Madison, Nc via Telnet
    • Bob Worm
      Sun Nov 1 20:35:20 2026
      from Wales, Uk via Telnet
    • Amstrad Ppc
      Sun Nov 1 19:14:41 2026
      from Wiltshire via Telnet
    • Amstrad Ppc
      Sun Nov 1 18:28:07 2026
      from Wiltshire via Telnet
    • Ben Longden
      Sun Nov 1 18:19:46 2026
      from Edinburgh, Uk via Telnet
    • Amstrad Ppc
      Sun Nov 1 16:48:50 2026
      from Wiltshire via Telnet
    • Amstrad Ppc
      Sun Nov 1 16:20:58 2026
      from Wiltshire via SSH
    • Rixter
      Sun Nov 1 12:01:35 2026
      from Madison, Nc via Telnet
  • System Info

    Sysop: Keyop
    Location: Huddersfield, West Yorkshire, UK
    Users: 797
    Nodes: 16 (2 / 14)
    Uptime: 184:35:21
    Calls: 13,202
    Calls today: 1
    Files: 15,490
    Messages: 6,579,500

© >>> Magnum BBS <<<, 2026