diff --git a/tap.ipp b/tap.ipp index 42e797f6..570b2513 100644 --- a/tap.ipp +++ b/tap.ipp @@ -39,7 +39,7 @@ template void util::TAP::logger::expect_eq (const T&a, const U &b, const std::string &msg) { - static const auto TEST = [] (const T &t, const U &u) -> bool { + static const std::function TEST = [] (const T &t, const U &u) -> bool { return almost_equal (t, u); }; @@ -52,7 +52,7 @@ template void util::TAP::logger::expect_neq (const T&a, const U &b, const std::string &msg) { - static const auto TEST = [] (const T &t, const U &u) -> bool { + static const std::function TEST = [] (const T &t, const U &u) -> bool { return !almost_equal (t, u); }; @@ -68,7 +68,8 @@ util::TAP::logger::expect_ ## SUFFIX (const T &a, \ const U &b, \ const std::string &msg) \ { \ - expect ([] (const T&t, const U&u) { return t OP u; }, a, b, msg); \ + static const std::function TEST = [] (const T&t, const U&u) { return t OP u; }; \ + expect (TEST, a, b, msg); \ } TAP_TEST(gt, > ) @@ -85,5 +86,5 @@ void util::TAP::logger::expect_nan (const T &t, const std::string &msg) { bool(*func)(T) = std::isnan; - expect (func, t, msg); + expect (std::function (func), t, msg); }