title: how to convert code c++11 to work in VS2010?
body: <pre><code>for( const auto &amp;i : lines )
          out &lt;&lt; i &lt;&lt; std::endl;
  </code></pre>
  
  <p>this code is not working on VS10.
  how can i change it with iterators ?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  
  #define find_str( a, b ) std::find( a.begin(), a.end(), b ) == a.end() 
  
  int main( int argc, const char* argv[] )
  {
      std::ifstream in( "input.txt" );
      std::ofstream out( "output.txt" );
      std::vector&lt;std::string&gt; lines, sorted_lines;
  
      if( !in )
      {
          std::cerr &lt;&lt; "Error: Couldn't open file input.txt";
          return -1;
      }
  
      std::string str, sorted_str;
  
      while( in )
      {
          std::getline( in, str );
          sorted_str = str;
          std::sort( sorted_str.begin(), sorted_str.end() );
  
          if( find_str( sorted_lines, sorted_str ) )
          {
              lines.push_back( str );
              sorted_lines.push_back( sorted_str );
          }
      }
      const auto i;
      for( const auto &amp;i : lines )
          out &lt;&lt; i &lt;&lt; std::endl;
  
      in.close();
      out.close();
  
      return 0;
  }
  </code></pre>