I'm getting an error(shown further below) when I try to copy values from a std::string vector to another std::string vector:
Using a similar command as the following:
Code:
g++ -g file.cpp -W -Wall -ansi -pedantic `sdl-config --cflags --libs` -lSDL -o file
The error:
Code:
p_keyboard.h:127: error: name lookup of `a_iter' changed for new ISO `for' scoping
p_keyboard.h:124: error: using obsolete binding at `a_iter'
Here is the code in which it is happening in.
Code:
for (unsigned int a_iter = 0; a_iter < keys_.size(); ++a_iter); // Line 124
{
keys[ keys.size() -1 ].resize(keys[ keys.size() -1 ].size() +1);
keys[ keys.size() -1 ][ a_iter ] = keys_[ a_iter ]; // Line 127
}
`keys_' is a parameter to the function this block of code exists in.
It looks like this:
Code:
int function(/*...*/ std::vector<std::string> keys_ /*...*/);
`keys' is a variable in a public part of a class.
It looks like this:
Code:
std::vector<std::vector<std::string> > keys;
As you can see I am trying to copy over the information from each element of `keys_', to every new element of `keys[ keys.size() -1 ][ a_iter ]'.
What am I doing wrong?
Any lack of information on my part, please notify me(not that anyone wouldn't
), so I can fill in the void.
Thanks in advance!