mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 03:57:20 +02:00
Added emplace(void) for older compilers
This commit is contained in:
@ -145,11 +145,16 @@ void test_clear_on_throw()
|
||||
|
||||
void test_no_assignment_on_emplacement()
|
||||
{
|
||||
optional<const std::string> os;
|
||||
optional<const std::string> os, ot;
|
||||
BOOST_TEST(!os);
|
||||
os.emplace("wow");
|
||||
BOOST_TEST(os);
|
||||
BOOST_TEST_EQ(*os, "wow");
|
||||
|
||||
BOOST_TEST(!ot);
|
||||
ot.emplace();
|
||||
BOOST_TEST(ot);
|
||||
BOOST_TEST_EQ(*ot, "");
|
||||
}
|
||||
|
||||
int main()
|
||||
|
Reference in New Issue
Block a user