libutil: allow moving Trace into Error

`pushTrace` now move-constructs or copy-constructs, instead of always
copy-constructing.

Change-Id: Ie5f02643e98b7a6c1adbe58b0d46d9e116eba28e
This commit is contained in:
Qyriad
2025-10-27 13:14:50 +01:00
parent 18efc848fe
commit b8462562f2
+6 -1
View File
@@ -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<typename... Args>
void addTrace(std::shared_ptr<Pos> && e, std::string_view fs, const Args & ... args)
{