6 ms·
I was pointing out vector objects (as opposed to rawpointers) mainly because I'm not aware of any other practical way to enable automated bounds checking. Apar
by jstimpfle 7y ago
I was pointing out vector objects (as opposed to rawpointers) mainly because I'm not aware of any other practical way to enable automated bounds checking.
Apart from that I actually find it more appealing and "correct" to have a separate length value. As soon as there are multiple parallel arrays the vector approach will have redundant length information, so from an aesthetical point from of view I prefer not to glue the length to the vector/array.
But yeah, with a separate length there is more manual work for simple tasks, so it's easier to mess up.