title: Access elements of boost tokenizer
body: <p>I'm trying to assign columns of a file using boost to a std::map.  I would like to assign element 0  from each line to the index and element 2 to the value.  Is there a way to do this without an iterator? The addr_lookup line does not work. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt; 
  #include &lt;string&gt;
  #include &lt;map&gt;
  #include &lt;boost/tokenizer.hpp&gt;
  #include &lt;boost/lexical_cast.hpp&gt;
  
  int main()
  {
    std::ifstream myfile("core_info_lowbits.tab", std::ios_base::in);
    std::string line;
    typedef boost::tokenizer&lt;boost::char_separator&lt;char&gt; &gt;  tokenizer;
    boost::char_separator&lt;char&gt; sep(" ");
    std::map&lt;std::string, unsigned int&gt; addr_lookup;
  
    while ( std::getline (myfile,line) )
    {
      tokenizer tokens(line, sep);
      //Line below does not work
      addr_lookup[*tokens.begin()] = boost::lexical_cast&lt;unsigned int&gt; (*(tokens.begin()+2));
      for (tokenizer::iterator tok_iter=tokens.begin();
           tok_iter != tokens.end(); ++tok_iter)
            std::cout &lt;&lt; *tok_iter &lt;&lt; std::endl;
    }
  }
  </code></pre>