C++ Logo


Advanced search

Re: scope guard

From: Peter C++ <peter.cpp_at_[hidden]>
Date: Tue, 3 Aug 2021 20:23:18 +0200
As the author of the paper with unique_resource and scope guards, I believe that unique_resource has some merit, but that scope guards (as in LFTS) are a design error, because using one means one has forgotten an abstraction. so any (generic) scope guard is a license to "cheat" C++ clean resource management.

Also I burnt out on that paper snd therefore refrained from proposing it any further. Feel free, to pick it up (the unique_resource part), I won't.


sent from a mobile device so please excuse strange words due to autocorrection.
Peter Sommerlad
+41-79-432 23 32

> On 3 Aug 2021, at 11:47, Baruch Burstein via Std-Proposals <std-proposals_at_[hidden]> wrote:
> Hi.
> Why is there no generic scope guard in the standard library?
> I am sure there must have been such a proposal before, probably with an explanation of why it was not accepted, but I couldn't find it.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2021-08-03 13:23:23