I have a lot of deques defined, and when I need to do things like erase or pop all of them, I’ve just had to do it to every deque specifically.
What i thought could make it easier was to put the deques in an array or list of some kind, which I could loop through.
What I want to do is something like this (Basicly just pseudocode):
deque<f32> pos, vel, rot, prop;
deque deques[] = {pos, vel, rot, prop};
for(i=0; i<deques.length; i++) deques[i].pop_back();
(But it doesn’t work)
Here you declare a simple unmanaged array:
…but you forget to declare the full specialised type of its contents, which should be
deque<f32>not just a nakeddeque.Now, you try to iterate over your array,
…but simple C-style arrays don’t have methods like
length. You seem to be trying to write C#, not C++!Try this:
etc.