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 ()
38 void FunctorTest::testIsFunctorFalse ()
constexpr bool IsFunctor()
Checks whether the given type has a Functor instance for it.
FmapResult_t< T, F > Fmap(const T &functor, const F &function)
Apply the function f to the elements in functor.