mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 10:28:09 +08:00
quit returning rvalue ref from unwrap_or
This commit is contained in:
@@ -406,10 +406,10 @@ struct result
|
|||||||
if(is_err()) {return opt;}
|
if(is_err()) {return opt;}
|
||||||
return this->succ.value;
|
return this->succ.value;
|
||||||
}
|
}
|
||||||
value_type&& unwrap_or(value_type opt) &&
|
value_type unwrap_or(value_type opt) &&
|
||||||
{
|
{
|
||||||
if(is_err()) {return std::move(opt);}
|
if(is_err()) {return opt;}
|
||||||
return std::move(this->succ.value);
|
return this->succ.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
error_type& unwrap_err() &
|
error_type& unwrap_err() &
|
||||||
|
Reference in New Issue
Block a user