From b8462562f25c72a39db7eb702049090c99f7ea1a Mon Sep 17 00:00:00 2001 From: Qyriad Date: Fri, 24 Oct 2025 17:06:24 +0200 Subject: [PATCH] libutil: allow moving Trace into Error `pushTrace` now move-constructs or copy-constructs, instead of always copy-constructing. Change-Id: Ie5f02643e98b7a6c1adbe58b0d46d9e116eba28e --- lix/libutil/error.hh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lix/libutil/error.hh b/lix/libutil/error.hh index 5306327b0..ea8e87f64 100644 --- a/lix/libutil/error.hh +++ b/lix/libutil/error.hh @@ -193,11 +193,16 @@ public: err.pos = pos; } - void pushTrace(Trace trace) + void pushTrace(Trace const & trace) { err.traces.push_front(trace); } + void pushTrace(Trace && trace) + { + err.traces.emplace_front(trace); + } + template void addTrace(std::shared_ptr && e, std::string_view fs, const Args & ... args) {