utils/result: add std::move version of Err
Avoid a copy in some situations
This commit is contained in:
@ -81,6 +81,13 @@ Err(const Result<T>& res)
|
||||
return res.error();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
static inline tl::unexpected<Error>
|
||||
Err(Result<T>&& res)
|
||||
{
|
||||
return std::move(res.error());
|
||||
}
|
||||
|
||||
/*
|
||||
* convenience
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user