forked from boostorg/optional
*** empty log message ***
[SVN r19997]
This commit is contained in:
@ -17,10 +17,13 @@
|
||||
//
|
||||
// THIS TEST SHOULD FAIL TO COMPILE
|
||||
//
|
||||
void test_no_direct_value_assignment()
|
||||
void test_no_implicit_conversion()
|
||||
{
|
||||
boost::optional<int> opt(3) ;
|
||||
opt = 4 ; // Cannot assign "int" to "optional<int>"
|
||||
boost::optional<int> opt(1) ;
|
||||
|
||||
// You can compare against 0 or against another optional<>,
|
||||
// but not against another value
|
||||
if ( opt == 1 ) ;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user