#include #include #include namespace { [[maybe_unused]] auto func_no_args() {} [[maybe_unused]] auto func_one_arg(int) {} struct S { auto operator()() {} }; struct T { template auto operator()() {} }; } // namespace TEST_CASE("is_function", "[type_traits]") { auto x = []() {}; STATIC_REQUIRE(not stdx::is_function_v); STATIC_REQUIRE(not stdx::is_function_v); STATIC_REQUIRE(not stdx::is_function_v); STATIC_REQUIRE(stdx::is_function_v); STATIC_REQUIRE(stdx::is_function_v); } TEST_CASE("is_function_object", "[type_traits]") { auto x = []() {}; auto y = [](int) {}; auto z = [](auto) {}; STATIC_REQUIRE(not stdx::is_function_object_v); STATIC_REQUIRE(not stdx::is_function_object_v); STATIC_REQUIRE(not stdx::is_function_object_v); STATIC_REQUIRE(stdx::is_function_object_v); STATIC_REQUIRE(stdx::is_function_object_v); STATIC_REQUIRE(stdx::is_function_object_v); STATIC_REQUIRE(stdx::is_function_object_v); STATIC_REQUIRE(stdx::is_function_object_v); } TEST_CASE("is_callable", "[type_traits]") { auto x = []() {}; auto y = [](int) {}; auto z = [](auto) {}; STATIC_REQUIRE(not stdx::is_callable_v); STATIC_REQUIRE(stdx::is_callable_v); STATIC_REQUIRE(stdx::is_callable_v); STATIC_REQUIRE(stdx::is_callable_v); STATIC_REQUIRE(stdx::is_callable_v); STATIC_REQUIRE(stdx::is_callable_v); STATIC_REQUIRE(stdx::is_callable_v); STATIC_REQUIRE(stdx::is_callable_v); }