| 237 | static_assert(is_callable<example_struct>::value, "bad"); |
| 238 | |
| 239 | void test_member_functions_and_data() |
| 240 | { |
| 241 | example_struct obj1(10); |
| 242 | std::unique_ptr<example_struct> obj2(new example_struct(11)); |
| 243 | std::shared_ptr<example_struct> obj3(new example_struct(12)); |
| 244 | |
| 245 | DLIB_TEST(dlib::invoke(&example_struct::get_i, obj1) == 10); |
| 246 | DLIB_TEST(dlib::invoke(&example_struct::i, obj1) == 10); |
| 247 | DLIB_TEST(dlib::invoke(&example_struct::get_i, &obj1) == 10); |
| 248 | DLIB_TEST(dlib::invoke(&example_struct::i, &obj1) == 10); |
| 249 | DLIB_TEST(dlib::invoke(&example_struct::get_i, obj2) == 11); |
| 250 | DLIB_TEST(dlib::invoke(&example_struct::i, obj2) == 11); |
| 251 | DLIB_TEST(dlib::invoke(&example_struct::get_i, obj3) == 12); |
| 252 | DLIB_TEST(dlib::invoke(&example_struct::i, obj3) == 12); |
| 253 | } |
| 254 | |
| 255 | // ---------------------------------------------------------------------------------------- |
| 256 | int return_int() |