1 #define BOOST_TEST_MODULE (maybe_ref test) 2 #include "boost/test/unit_test.hpp" 6 BOOST_AUTO_TEST_SUITE(maybe_ref)
15 BOOST_TEST(m.
ref() == 16);
19 T
const& r2 = m.
ref();
20 BOOST_TEST(m.
ref() == 16);
22 BOOST_TEST(&r2 == &x);
28 BOOST_CHECK_THROW(m.
ref(), std::logic_error);
39 BOOST_TEST(m.
ref() == 16u);
41 BOOST_TEST(m2.isValid());
42 BOOST_TEST(m2.ref() == 16u);
49 BOOST_TEST(m.
ref() == 16);
51 BOOST_TEST(!m2.isValid());
53 BOOST_TEST(m2.isValid());
54 BOOST_TEST(m2.ref() == 16);
79 BOOST_TEST(m.
ref() == 16);
80 BOOST_TEST(&m.
ref() == &
x);
85 BOOST_TEST(m.
ref() == 48);
86 BOOST_TEST(&m.
ref() == &
y);
90 BOOST_AUTO_TEST_SUITE_END()
static constexpr double m2
BOOST_AUTO_TEST_CASE(default_behavior)