Re: [boost] [scope] Proposing Boost.Scope

22 Mar
2023
22 Mar
'23
12:25 p.m.
On 3/22/23 14:23, Daniela Engert via Boost wrote:
I didn't know you can apply [[nodiscard]] to classes, but apparently you can. I suppose, I could mark scope guards with it, but I'm not sure if limiting the use cases would be desirable. For example, should we consider the following a wrong use of the scope guard? auto foo() { // do something useful and return the epilogue return scope_exit([] { whatever }); } void bar() { foo(); // do what foo() does, plus the epilogue // ... } void zoo() { auto epilogue = foo(); // do what foo() does, and delay the epilogue // ... }
825
Age (days ago)
825
Last active (days ago)
0 comments
1 participants
participants (1)
-
Andrey Semashev