On Monday, 2 October 2023 at 19:04:19 UTC, MrSmith33 wrote:
On Thursday, 28 September 2023 at 23:28:02 UTC, Guillaume Piolat wrote:
- manual push/pop

I wonder if `with` statement is helpful here to reduce verbosity

Do you mean with:

    with(scopedContext())
    {
        set!int("myVar", 5);
    }

    ScopedContext scopedContext() { /* blah */ }

    struct ScopedContext
    {
        ~this() { context.pop; }
    }


Because at a point there was such a RAII context wrapper. I didn't realize, `with` extends its lifetime to the scope?

Reply via email to