2 ms·
this kind of stuff has always scared me. Its seems like it would be really easy to get confused just trying to use this stuff. Generally if i need a list i ei
by lukesandberg 16y ago
this kind of stuff has always scared me. Its seems like it would be really easy to get confused just trying to use this stuff. Generally if i need a list i either use the void* interface and cast as neccesary, or if i want to do something like store a list of floats, or anything where i want to store the value of the item in the list (not just a pointer) then i use a 'fat' datastructure like this
https://github.com/lukesandberg/Regex/blob/master/src/util/fat_stack.h https://github.com/lukesandberg/Regex/blob/master/src/util/f...
when you construct it you just tell it how big each item is then it copies the value into the stack element for storage.
Sometimes it a few extra copy/cast statements but at least its very clear what you are doing.