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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user