table: test emplace function

This commit is contained in:
Michele Caini
2024-05-03 09:47:23 +02:00
parent 3a97180b63
commit b6a71dbdbe

View File

@@ -368,6 +368,15 @@ TEST(Table, IteratorConversion) {
ASSERT_NE(++cit, it);
}
TEST(Table, Emplace) {
entt::table<int, char> table;
testing::StaticAssertTypeEq<decltype(table.emplace()), std::tuple<int &, char &>>();
ASSERT_EQ(table.emplace(), std::make_tuple(int{}, char{}));
ASSERT_EQ(table.emplace(3, 'c'), std::make_tuple(3, 'c'));
}
TEST(Table, Indexing) {
entt::table<int, char> table;