From 3358ea840835c4c1e42d2c2747cfd26c43517ffb Mon Sep 17 00:00:00 2001 From: Nitin Kumar <59679977+lazysegtree@users.noreply.github.com> Date: Thu, 16 Apr 2026 17:46:39 +0530 Subject: [PATCH] Fix: Capture current by reference to avoid stale value --- include/cxxopts.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index bff8cde..891e78a 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -2271,7 +2271,7 @@ wrap_text // that [itr, current] doesn't contains any space. // either its called with itr = std::next(current) // or with an itr <= current in case of word splitting - auto reset_line_start = [&size, &startLine, &lastSpace, &contentEnd, &lastSpaceContentEnd, current](Iterator itr, Iterator lineContentEnd) { + auto reset_line_start = [&size, &startLine, &lastSpace, &contentEnd, &lastSpaceContentEnd, ¤t](Iterator itr, Iterator lineContentEnd) { startLine = itr; lastSpace = startLine; contentEnd = lineContentEnd;