mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-01-05 07:11:08 +00:00
remove template argument from result::unwrap_or
This commit is contained in:
parent
7b3684b54e
commit
24723226f1
@ -396,20 +396,17 @@ struct result
|
|||||||
return std::move(this->succ.value);
|
return std::move(this->succ.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename U>
|
value_type& unwrap_or(value_type& opt) &
|
||||||
value_type& unwrap_or(U& opt) &
|
|
||||||
{
|
{
|
||||||
if(is_err()) {return opt;}
|
if(is_err()) {return opt;}
|
||||||
return this->succ.value;
|
return this->succ.value;
|
||||||
}
|
}
|
||||||
template<typename U>
|
value_type const& unwrap_or(value_type const& opt) const&
|
||||||
value_type const& unwrap_or(U const& opt) const&
|
|
||||||
{
|
{
|
||||||
if(is_err()) {return opt;}
|
if(is_err()) {return opt;}
|
||||||
return this->succ.value;
|
return this->succ.value;
|
||||||
}
|
}
|
||||||
template<typename U>
|
value_type&& unwrap_or(value_type opt) &&
|
||||||
value_type&& unwrap_or(U&& opt) &&
|
|
||||||
{
|
{
|
||||||
if(is_err()) {return std::move(opt);}
|
if(is_err()) {return std::move(opt);}
|
||||||
return std::move(this->succ.value);
|
return std::move(this->succ.value);
|
||||||
|
Loading…
Reference in New Issue
Block a user