43 void MonadPlusTest::testBoostOptionalMplus ()
45 const boost::optional<int> val1 { 1 };
46 const boost::optional<int> val2 { 2 };
47 const auto nothing = Mzero<boost::optional<int>> ();
49 const auto res1 = val1 + val2;
50 const auto res2 = val1 + nothing;
51 const auto res3 = nothing + val1;
52 const auto res4 = nothing + nothing;
54 QCOMPARE (res1, val1);
55 QCOMPARE (res2, val1);
56 QCOMPARE (res3, val1);
57 QCOMPARE (res4, nothing);