I have a (hopefully) easy question. Suppose I create a list and I want to be able to have the user enter entries that will be "pushed" into the list until they enter x on a line by itself (or enter on a line by itself, I'm not picky) How would one go about this? This is what I have right now and it's just not working:

Code:
#include <iostream>
#include <list>
#include <string>

int main()
{
	string line;
    list<string> stringList;

	cout << "Provide a list of characters, press x on a line by itself" << 
		     " when done." << endl;
    
	if (line !="x")
	{
		getline(cin,line);
        stringList.push_back(line);
	}

return 0;
}
The compiler (VC ++ 6.0) gives some very strange error messages such as:

warning C4786: 'std::reverse_bidirectional_iterator<std::list<std ::basic_string<char,std::char_traits<char>,std::al locator<char> >,std::allocator<std::basic_string<char,std::cha
r_traits<char>,std::allocator<char> > > >::iterator,std::basic_string<char,std::char_trait s<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,st d::allocator<char> > &,std::basic_string<char,std::char_traits

I am assuming this means that by doing
my if statement I've somehow put it into some sort of prepetual loop, but I
am not sure of how to accomplish what
I am looking to do. Ultimately, I'd like to be able to take as much user input as the user wants to enter, stick each entry in a list and display it. I then want to implement a counting function (templated function) that will take in an item as its argument and count how many times that item occurs in the list...

I'm just working on the simplest part first before pursuing the counting part...

Thanks for any help that can be provided..