title: c++ vector of struct, why can't i use vector.at(i) or vector[i] for struct?
body: <pre><code>struct info{
    int num;
    int weight;
  };
  vector&lt;info&gt; nbr;
  </code></pre>
  
  <p>the above declarations are global, and I have a loop in my function that looked like this</p>
  
  <pre><code>for(int i=0;i&lt;nbr.size();i++){
    info i = nbr.at(i);
    vector&lt;int&gt; v;
    v.push_back(i.weight);
    tb[i.num] = v;
  }
  </code></pre>
  
  <p><code>info i = nbr.at(i)</code> gives me error: no matching function for call to <code>'std::vector&lt;info, std::allocator&lt;info&gt; &gt;::at(info&amp;)'</code></p>
  
  <p>why? what did I do wrong?</p>