title: c++ compile error: unexpected type name 'string': expected expression
body: <p>I want to use c++ stl list and use iterator to print all the elements. Here is the code:</p>
  
  <pre><code>#include&lt;list&gt;
  #include&lt;algorithm&gt;
  #include&lt;string&gt;
  using namespace std;
  int main(int argc, char* argv[]){
          list&lt;string&gt; list;
          //list&lt;double&gt; list_double(6);
          //list&lt;int&gt; list_int(6, 0);
          //list&lt;double&gt; list_double2(6, 0,0);
          //list&lt;int&gt; else_list(list_int);
          //list&lt;double&gt; iter(list_double.begin(), list_double.end());
          list.push_front("1 jack");
          list.push_front("2 jackson");
          list.push_front("3 sally");
  
          list&lt;string&gt;::iterator itrr;
          for (itrr = list.begin(); itrr!= list.end(); itrr++){
                  string temp = *itrr;
                  print(temp)nt main(int argc, char* argv[]){
          list&lt;string&gt; list;
          //list&lt;double&gt; list_double(6);
          //list&lt;int&gt; list_int(6, 0);
          //list&lt;double&gt; list_double2(6, 0,0);
          //list&lt;int&gt; else_list(list_int);
          //list&lt;double&gt; iter(list_double.begin(), list_double.end());
          list.push_front("1 jack");
          list.push_front("2 jackson");
          list.push_front("3 sally");
  
          list&lt;string&gt;::iterator itrr;
          for (itrr = list.begin(); itrr!= list.end(); itrr++){
                  string temp = *itrr;
                  print(temp);
          }
          return 0;
  }
  
  
          }
          return 0;
  }
  </code></pre>
  
  <p>and when I tried to compile it, it shows some errors :</p>
  
  <pre><code>list.cpp:17:7: error: unexpected type name 'string': expected expression
          list&lt;string&gt;::iterator itrr;
               ^
  list.cpp:17:16: error: cannot refer to class template 'iterator' without a template argument list
          list&lt;string&gt;::iterator itrr;
                      ~~^
  /Library/Developer/CommandLineTools/usr/include/c++/v1/iterator:522:29: note: template is declared here
  struct _LIBCPP_TEMPLATE_VIS iterator
                              ^
  list.cpp:18:7: error: use of undeclared identifier 'itrr'
          for (itrr = list.begin(); itrr!= list.end(); itrr++){
               ^
  list.cpp:18:28: error: use of undeclared identifier 'itrr'
          for (itrr = list.begin(); itrr!= list.end(); itrr++){
                                    ^
  list.cpp:18:47: error: use of undeclared identifier 'itrr'
          for (itrr = list.begin(); itrr!= list.end(); itrr++){
                                                       ^
  list.cpp:19:18: error: use of undeclared identifier 'itrr'
                  string temp = *itrr;
                                 ^
  </code></pre>
  
  <p>so what is wrong? Thanks!</p>