utempl/tests/overloaded.cpp

20 lines
297 B
C++
Raw Normal View History

#include <gtest/gtest.h>
#include <utempl/utempl.hpp>
namespace utempl {
TEST(Overloaded, Basic) {
2024-07-31 02:19:28 +00:00
constexpr auto f = Overloaded(
[](int) {
return 1;
},
[](auto&&) {
return 2;
});
EXPECT_EQ(f(1), 1);
EXPECT_EQ(f(""), 2);
};
2024-07-31 02:19:28 +00:00
} // namespace utempl