On 12/2/23 17:30, Peter Dimov via Boost wrote:
(And maybe rename it to BOOST_SCOPE_DEFER.)
Would you also propose to rename the scope_final class template? What name would you suggest? Interestingly, there seems to be a proposal to add `defer` to C: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2895.htm So I guess, we should avoid taking the word `defer` in case it becomes a keyword some day. I'm not opposed to renaming, as long as the new name is short and not misleading. I'm not familiar with Go (presumably, from which the name comes), so I can't tell how similar the semantics of the feature in Go is to the proposed library. FWIW, in BOOST_SCOPE_FINAL, "final" is partly a reference to `__try`/`__finally` in MSVC and `try`/`finally` in Java, and partly emphasizes that the scope guard is "final" after construction, i.e. cannot be modified or cancelled. It also reads almost like "finale of the scope". I like it.