i've found out a problem when using array, which is for example I stored some scene nodes in an array, and would like to delete some of it later using for-loop
I realize scene nodes that are in the end of the list didn't get deleted. i think array auto sorted the list when i use erase(), bringing the elements at the back in-front to fill in the blank am I correct?
I don't want to do that I want to manually sort() the list after I done my removals. Any way to do that? Thanks.
Last edited by Virion on Sun Feb 14, 2010 9:57 pm, edited 1 time in total.
your approach is a bit strange. If you erase something from a container it will be delete. The container just rearrange all elements. That correct. Thats not really a sort. Its more a shift operation. There is no way to "mark" some of the elements and delete it later in one big call. The only way i now is to use another container putting the kept elements in and swap the contents of the container later.
nevermind... i cleared the array and re-add all scene nodes into the list again after deleted the unwanted scene nodes. i know, it's a bit strange but this is the only way that works for me now.
p/s. i don't know why but the reverse order just doesn't work it crashes.