cannot use obsolete binding at ‘input’ because it has a destructor
- by ihm
here's the word-count I wrote. I got this error: cannot use obsolete binding at ‘input’ because it has a destructor and error: name lookup of ‘input’ changed for ISO ‘for’ scoping what are they suppose to mean? thanks in advance.
//rewrite the word-count program using insert instead of subscripting
#include <iostream>
#include <utility>
#include <map>
#include <string>
using namespace std;
int main ()
{
cout<<"please enter some words"<<endl;
map<string,int> word_count;
for(string input; cin>>input; )
if(!word_count.insert(make_pair(input,1)).second);
++word_count[input];
for(map<string,int>::iterator iter=word_count.begin(); iter!=word_count.end(); ++iter)
cout<<iter->first<<": "<<iter->second<<endl;
return 0;
}