mirror of
https://github.com/boostorg/variant2.git
synced 2025-07-30 20:27:17 +02:00
Add expected::operator>> as an alias for .then
This commit is contained in:
@ -409,6 +409,18 @@ public:
|
||||
return unexpected();
|
||||
}
|
||||
}
|
||||
|
||||
template<class F> then_result<F, T const&> operator>>( F && f ) const
|
||||
{
|
||||
if( has_value() )
|
||||
{
|
||||
return std::forward<F>(f)( **this );
|
||||
}
|
||||
else
|
||||
{
|
||||
return unexpected();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<class T, class... E> inline constexpr bool operator==( expected<T, E...> const & x1, expected<T, E...> const & x2 )
|
||||
|
Reference in New Issue
Block a user