5 ms·
You can allocate your data the same way, especially using custom allocators in C++. And every reference requires some arithmetic too, if you're worrying about
by gumby 3y ago
You can allocate your data the same way, especially using custom allocators in C++. And every reference requires some arithmetic too, if you're worrying about that.
But my point is that storing them in another array doesn't buy you a lot if you allow deallocations (you can then still have a use-after-free, or even read the wrong object) while if you don't deallocate you might as well just use pointers.
Just trying to understand the benefit of going to all this work. I can see the point in old FORTRAN code before FORTRAN 90
- lelandbatey 3y agoI think it's mostly just an experiment, example, proof-of-concept or other "toy" implementation demonstrating/exploring the idea.
- gumby 3y agoYeah, no judgement on that. But I’ve worked with indexed classes (mixin class) to avoid pointers in the past and have never found them worth the effort. Since someone else is mentioning it here on HN I’m asking if there is an advantage over pointers that I don’t realise — if so I might be glad to take advantage of it myself.