basedOpinionated utility library |
git clone git://git.dimitrijedobrota.com/based.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |
invoke_result_test.cpp (690B)
0 #define CATCH_CONFIG_RUNTIME_STATIC_REQUIRE
2 #include "based/trait/invoke_result.hpp"
4 #include <catch2/catch_test_macros.hpp>
6 #include "based/concept/is_same.hpp"
8 namespace
9 {
11 // NOLINTNEXTLINE(*needed*)
12 int func(double);
14 } // namespace
16 template<class Res, class T, class... Args>
17 concept Test =
18 based::trait::IsSame<based::trait::InvokeResult<T, Args...>, Res>;
20 TEST_CASE("invoke_result", "[trait/invoke_result]")
21 {
22 // NOLINTBEGIN(*array*)
23 // clang-format off
25 STATIC_REQUIRE(Test<int, decltype(func), double>);
26 STATIC_REQUIRE(Test<int, decltype(func), int>);
27 STATIC_REQUIRE(!Test<int, decltype(func), decltype(func)>);
29 // clang-format on
30 // NOLINTEND(*array*)
31 }