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

Function test_function_view

dlib/test/te.cpp:359–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357 }
358
359 void test_function_view()
360 {
361 auto f = [a = 42](int i) mutable {a += i; return a;};
362 dlib::any_function_view<int(int)> g(f);
363
364 DLIB_TEST(f(1) == 43);
365 DLIB_TEST(g(1) == 44);
366 DLIB_TEST(f(1) == 45);
367 DLIB_TEST(g(1) == 46);
368 }
369
370 void global_function1(int& a) {a += 1;}
371

Callers 1

perform_testMethod · 0.85

Calls 1

fFunction · 0.70

Tested by

no test coverage detected