what is wrong with the following?
Code:
#include <algorithm>
#include <iostream>
#include <list>
#include <set>
#include <string>
using namespace std;
int main()
{
typedef set<string> WordSet;
typedef WordSet::iterator WordIter;
typedef list<WordIter> Index;
WordSet words;
Index input_order;
for (string new_word; cin >> new_word, new_word != "Quit";)
{
pair<WordIter, bool> &trace = words.insert(new_word);
if (trace.second)
input_order.push_back(trace.first);
}
copy(input_order.begin(), input_order.end(),
ostream_iterator<string>(cout, "\n"));
copy(words.begin(), words.end(),
ostream_iterator<string>(cout, "\n"));
return 0;
}
when I try to compile I get an error at line 18...
Illegal Implicit conversion
why? I dont get it..
Im using code warior 7.0 on mac os X..
Luigi
thx..