3 ms·
So essentially, you are using indices rather than pointers. Indices have advantages: they can be more compact, and they are position-independent. But you need
by GuB-42 2y ago
So essentially, you are using indices rather than pointers.
Indices have advantages: they can be more compact, and they are position-independent. But you need a base pointer, and a bit more computation. It also requires you to have your own allocator, as your typical heap allocator will just give you an arbitrary pointer to your object.