36 auto [idx1, ptr1] = pool.
emplace(10);
38 CHECK(&pool[idx1] == ptr1);
44 auto [idx2, ptr2] = pool.
emplace(20);
47 CHECK(&pool[idx1] == ptr1);
48 CHECK(&pool[idx2] == ptr2);
53 auto [idx3, ptr3] = pool.
emplace(30);
57 CHECK(&pool[idx1] == ptr1);
58 CHECK(&pool[idx2] == ptr2);
59 CHECK(&pool[idx3] == ptr3);
67 CHECK(&pool[idx1] == ptr1);
68 CHECK(&pool[idx3] == ptr3);
73 auto [idx4, ptr4] = pool.
emplace(40);
78 CHECK(&pool[idx1] == ptr1);
79 CHECK(&pool[idx3] == ptr3);
80 CHECK(&pool[idx4] == ptr4);
86 for (
auto i :
xrange(1000)) {
88 auto [idx, ptr] = pool.
emplace(val);
90 CHECK(&pool[idx] == ptr);
EmplaceResult emplace(Args &&...args)
static std::vector< int > constructed
Tracked & operator=(const Tracked &)=delete
Tracked & operator=(Tracked &&)=delete
Tracked(Tracked &&)=delete
static std::vector< int > destructed
Tracked(const Tracked &)=delete
constexpr auto xrange(T e)