From 87efddba1fe07996b0cd6878b156d8f77080a61b Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Tue, 3 Feb 2026 10:39:53 +0100 Subject: [PATCH] Avoid creation of temp_result object in seq_parser The object is never used, only its type is used. --- include/boost/parser/parser.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/boost/parser/parser.hpp b/include/boost/parser/parser.hpp index caf72e85..6c37e823 100644 --- a/include/boost/parser/parser.hpp +++ b/include/boost/parser/parser.hpp @@ -4292,10 +4292,10 @@ namespace boost { namespace parser { { Iter first = first_; - auto temp_result = - make_temp_result(first, last, context, skip, flags, success); + using temp_result_t = + decltype(make_temp_result(first, last, context, skip, flags, success)); - std::decay_t{}))> + std::decay_t(), llong<0>{}))> retval{}; [[maybe_unused]] auto _ = detail::scoped_trace( @@ -4307,9 +4307,9 @@ namespace boost { namespace parser { : flags, retval); - std::decay_t{}))> + std::decay_t(), llong<1>{}))> indices; - std::decay_t{}))> + std::decay_t(), llong<2>{}))> merged; call_impl( first, @@ -4360,13 +4360,13 @@ namespace boost { namespace parser { Iter first = first_; - auto temp_result = - make_temp_result(first, last, context, skip, flags, success); + using temp_result_t = + decltype(make_temp_result(first, last, context, skip, flags, success)); using temp_result_attr_t = - std::decay_t{}))>; - std::decay_t{}))> + std::decay_t(), llong<0>{}))>; + std::decay_t(), llong<1>{}))> indices; - std::decay_t{}))> merged; + std::decay_t(), llong<2>{}))> merged; auto max_ = [](auto result, auto x) { if constexpr (decltype(result)::value < decltype(x)::value) {