| 455 | }; |
| 456 | |
| 457 | void test_bind_front() |
| 458 | { |
| 459 | // Pure function |
| 460 | static_assert(dlib::bind_front(test_bind_func, 50)(3) == 47, "this should be constexpr"); |
| 461 | DLIB_TEST(dlib::bind_front(test_bind_func, 50)(3) == 47); |
| 462 | |
| 463 | // Member function |
| 464 | static_assert(dlib::bind_front(&test_bind_func_class::minus, test_bind_func_class{50})(3) == 47, "this should be constexpr"); |
| 465 | DLIB_TEST(dlib::bind_front(&test_bind_func_class::minus, test_bind_func_class{50})(3) == 47); |
| 466 | DLIB_TEST(dlib::bind_front(&test_bind_func_class::minus, std::make_shared<test_bind_func_class>(50))(3) == 47); |
| 467 | |
| 468 | // Lambda |
| 469 | DLIB_TEST(dlib::bind_front([](int a, int b) {return a - b;}, 50)(3) == 47); |
| 470 | } |
| 471 | |
| 472 | void test_bind_back() |
| 473 | { |
no test coverage detected