StructureOfArrays can push_back move-only types
This commit is contained in:
committed by
Mathias Agopian
parent
960c6170fe
commit
3c77d2c3f5
@@ -173,3 +173,13 @@ TEST(StructureOfArraysTest, Simple) {
|
||||
soa.push_back(0.0f, 1.0, std::move(destroyedFloat4));
|
||||
}
|
||||
|
||||
TEST(StructureOfArraysTest, MoveOnly) {
|
||||
StructureOfArrays<float, std::unique_ptr<int32_t>> soa;
|
||||
soa.setCapacity(2);
|
||||
soa.push_back(1.0f, std::make_unique<int32_t>(1));
|
||||
soa.push_back(2.0f, std::make_unique<int32_t>(2));
|
||||
EXPECT_EQ(soa.size(), 2);
|
||||
EXPECT_EQ(*soa.elementAt<1>(0).get(), 1);
|
||||
EXPECT_EQ(*soa.elementAt<1>(1).get(), 2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user