From a6f8273a49885e1597999977590a9590cb754125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=2E=20Patrick=20Urbanke=20=28=E5=8A=89=E8=87=AA=E6=88=90?= =?UTF-8?q?=29?= Date: Thu, 23 Jul 2026 00:03:21 +0200 Subject: [PATCH] Explicitly capture key; fixes #699 --- src/rfl/env/Writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rfl/env/Writer.cpp b/src/rfl/env/Writer.cpp index ba54a3b1..d0b7a8f0 100644 --- a/src/rfl/env/Writer.cpp +++ b/src/rfl/env/Writer.cpp @@ -133,7 +133,7 @@ void Writer::end_array(OutputArrayType* _arr) const noexcept { void Writer::end_object(OutputObjectType* _obj) const noexcept { const auto& obj = *_obj; for (const auto& [key, value] : *obj.fields) { - value.visit([&](const auto& _v) { + value.visit([&, key](const auto& _v) { using T = std::remove_cvref_t; if constexpr (std::is_same_v) { portable_setenv((obj.prefix + key).c_str(), _v.value.c_str());