Rian Quinn

Results 55 comments of Rian Quinn

@galik What if you forget to write the `finally` in the first place? All we are doing here is adding an additional capability to `finally` so that it can be...

@MikeGitb I `dismiss` too.

What about adding another class to the GSL that is a more traditional "commit or rollback"? Rolling back state changes in the event of an exception is a _HUGE_ issue...

It doesn't minus it takes a lambda function instead of a mutex.

I disagree. Lambda's really simplify what is needed to handle rolling back state. I submit one of my better examples (will be presenting this example at CppCon): https://github.com/Bareflank/hypervisor/blob/master/bfvmm/src/vmxon/src/vmxon_intel_x64.cpp#L38 We are...

Yes. We are using finally simply because the internal implementation is exactly the same thing we had which is in the link above. It was called CommitOrRollback. Since the code...

In this case, yes, only executing on an exception would work and its the main reason we use this pattern. That being said, is it possible to implement such a...

IMO not only should it be supported by the guidelines, but there should be an example given to demonstrate the issue, and how this pattern can be used to solve...

So that's what I brought up before... this really makes the code worse because every single function would need a try, cach, rethrow like you have above, which is IMO.......

@galik One thing I might add is that if it's called something other than gsl::finally, the analysis tool (e.g. Clang Tidy) could easily detect the creation of a `commit_or_rollback` object...