Beginner programmer: flat array using std::vector Intermediate programmer: complex data structure using custom templates containers and allocators Expert programmer: flat array using malloc.
-
-
It's just way #382 out of 59,453 that C++ makes the slow way to do things the default "recommended" way to do things :( Basically all of std is like this. It's all bad design that shouldn't be used in the first place, let alone reused.
-
And of course I didn't even mention the case where you don't need the count at all. So for example, if you knew that you always have the same number of points as normals, well that's completely impossible with std, because you can't have one count for two pointers.
End of conversation
New conversation -
-
-
If only it was that simple! std::vector will usually at least store data, length, and capacity, so that's 24 bytes already, even if you know the size up-front. But in practice (with gcc at least), it stores start and end pointers, so just getting the count might be a division.
-
Yeah sorry, I should have said, "you get _at least_ this bad". But the actual situation could be unboundedly worse depending on the implementation.
End of conversation
New conversation -
-
-
From the high level view, this actually is SOA vs AOS, extended to the data around your payload.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.