forked from boostorg/system
Enable result<void> &= fr. Refs #117.
This commit is contained in:
1 parent
cedf6eb581
commit
c7a0ce3349
2 files changed
+39
No files matched your search
@@ -80,6 +80,16 @@ result<int&, E2> fri2( int& )
|
||||
return E2();
|
||||
}
|
||||
|
||||
result<void, E2> fv()
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
result<void, E2> fv2()
|
||||
{
|
||||
return E2();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
@@ -122,5 +132,18 @@ int main()
|
||||
BOOST_TEST( r.has_error() );
|
||||
}
|
||||
|
||||
{
|
||||
result<void, E2> r;
|
||||
|
||||
r &= fv;
|
||||
BOOST_TEST( r.has_value() );
|
||||
|
||||
r &= fv2;
|
||||
BOOST_TEST( r.has_error() );
|
||||
|
||||
r &= fv;
|
||||
BOOST_TEST( r.has_error() );
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
Reference in new issue
Block a user