The question is valid, but not valid on StackOverflow.com. You must ask this question in a forum. See the rules.
The problem lies here:
std::string s = "one two two three one one two";
std::istringstream iss(std::move(s));
while (iss >> s)
{
int tmp = ++s1[s];
You are trying to initialize a variable (int tmp) in a while loop. If you are a computer then this is what you see: Do a while loop with a condition (correct), initialize a NEW variable called tmp with this calculation.
Once the loop goes to the second itteration, you tell him, 'initialize a NEW variable called tmp with this calculation', but tmp was already initialized and therefore it's a error.
The solution is:
std::string s = "one two two three one one two";
std::istringstream iss(std::move(s));
int tmp;
while (iss >> s)
{
tmp = ++s1[s];