underlying container of ClusterVcetor is now a std::vector

This commit is contained in:
Mazzoleni Alice Francesca
2025-04-07 12:27:44 +02:00
parent 9de84a7f87
commit a12e43b176
4 changed files with 162 additions and 30 deletions

View File

@ -25,10 +25,7 @@ TEST_CASE("ClusterVector 2x2 int32_t capacity 4, push back then read",
REQUIRE(cv.size() == 1);
REQUIRE(cv.capacity() == 4);
// Read the cluster back out using copy. TODO! Can we improve the API?
Cluster<int32_t, 2, 2> c2;
std::byte *ptr = cv.element_ptr(0);
std::copy(ptr, ptr + cv.item_size(), reinterpret_cast<std::byte *>(&c2));
auto c2 = cv.at(0);
// Check that the data is the same
REQUIRE(c1.x == c2.x);