title: How to erase value from vector of struct using erase-remove idiom?
body: <p>How to erase all values from vector of struct, where struct value k equals to 0?</p>
  
  <pre><code>struct tabuRecord {
  int x;
  int y;
  int k;
  tabuRecord( int x, int y, int k)
      : x(x), y(y), k(k){}
  };  
  
  vector &lt;tabuRecord&gt; tabu;
  
  v.insert(v.begin(), tabuRecord(1, 2, 3));
  v.insert(v.begin(), tabuRecord(4, 5, 0));
  v.insert(v.begin(), tabuRecord(7, 8, 9));
  v.insert(v.begin(), tabuRecord(10, 11, 0));
  </code></pre>
  
  <p>I have tried to </p>
  
  <pre><code>tabu.erase(std::remove(tabu.begin(), tabu.end(), tabu.k=0), tabu.end());
  </code></pre>
  
  <p>and</p>
  
  <pre><code>tabu.erase(std::remove(tabu.begin(), tabu.end(), tabuRecord.k=0), tabu.end());
  </code></pre>