| 429 | }; |
| 430 | |
| 431 | void test_constexpr() |
| 432 | { |
| 433 | static_assert(dlib::invoke(multiply_ints, 2, 5) == 10, "this should be constexpr"); |
| 434 | static_assert(dlib::invoke_r<long>(multiply_ints, 2, 5) == 10, "this should be constexpr"); |
| 435 | constexpr constexpr_object constexpr_obj; |
| 436 | #if defined (_MSC_VER) |
| 437 | constexpr_obj; // avoid warning C4101: 'constexpr_obj': unreferenced local variable |
| 438 | #endif |
| 439 | static_assert(dlib::invoke(&constexpr_object::multiply_ints, constexpr_obj, 2, 5) == 10, "this should be constexpr"); |
| 440 | static_assert(dlib::invoke_r<long>(&constexpr_object::multiply_ints, constexpr_obj, 2, 5) == 10, "this should be constexpr"); |
| 441 | } |
| 442 | |
| 443 | // ---------------------------------------------------------------------------------------- |
| 444 | |