MCPcopy Create free account
hub / github.com/davisking/dlib / test_bind_front

Function test_bind_front

dlib/test/invoke.cpp:457–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

perform_testMethod · 0.85

Calls 1

bind_frontFunction · 0.85

Tested by

no test coverage detected