19 void FunctorTest::testBoostOptionalFMap ()
21 std::optional<int> value { 2 };
22 const auto& fmapped =
Fmap (value, [] (
int val) {
return QString::number (val); });
23 QCOMPARE (std::optional<QString> {
"2" }, fmapped);
26 void FunctorTest::testBoostOptionalFMapEmpty ()
28 std::optional<int> value;
29 const auto& fmapped =
Fmap (value, [] (
int val) {
return QString::number (val); });
30 QCOMPARE (std::optional<QString> {}, fmapped);
33 void FunctorTest::testIsFunctorTrue ()
35 static_assert (
IsFunctor<std::optional<int>> (),
"test failed");
38 void FunctorTest::testIsFunctorFalse ()
40 static_assert (!IsFunctor<int> (),
"test failed");