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

Function test_bind_back

dlib/test/invoke.cpp:472–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470 }
471
472 void test_bind_back()
473 {
474 // Pure function
475 static_assert(dlib::bind_back(test_bind_func, 50)(3) == -47, "this should be constexpr");
476 DLIB_TEST(dlib::bind_back(test_bind_func, 50)(3) == -47);
477
478 // Member function
479 static_assert(dlib::bind_back(&test_bind_func_class::minus, 50)(test_bind_func_class{3}) == -47, "this should be constexpr");
480 DLIB_TEST(dlib::bind_back(&test_bind_func_class::minus, 50)(test_bind_func_class{3}) == -47);
481 DLIB_TEST(dlib::bind_back(&test_bind_func_class::minus, 50)(std::make_shared<test_bind_func_class>(3)) == -47);
482
483 // Lambda
484 DLIB_TEST(dlib::bind_back([](int a, int b) {return a - b;}, 50)(3) == -47);
485 }
486
487 // ----------------------------------------------------------------------------------------
488

Callers 1

perform_testMethod · 0.85

Calls 1

bind_backFunction · 0.85

Tested by

no test coverage detected