19 lines
297 B
C++
19 lines
297 B
C++
#include <gtest/gtest.h>
|
|
|
|
#include <utempl/utempl.hpp>
|
|
|
|
namespace utempl {
|
|
|
|
TEST(Overloaded, Basic) {
|
|
constexpr auto f = Overloaded(
|
|
[](int) {
|
|
return 1;
|
|
},
|
|
[](auto&&) {
|
|
return 2;
|
|
});
|
|
EXPECT_EQ(f(1), 1);
|
|
EXPECT_EQ(f(""), 2);
|
|
};
|
|
|
|
} // namespace utempl
|