title: How can I adapt the erase-remove idiom to work with vector tuples?
body: <p>I have a vector of tuples with members j, k, and l. I am trying to adapt the erase-remove idiom such that I can remove an entire tuple if the value of the .k member meets a certain condition.</p>
  
  <p>I tried using the standard .erase(removeif()) methodology where the predicate referenced the tuple member position, but was told that the class of vector in question has no member "k".</p>
  
  <pre><code>vec_list_iter_exp_out.erase(
      std::remove_if(
          vec_list_iter_exp_out.begin(),
          vec_list_iter_exp_out.end(), 
          vec_list_iter_exp_out.k &lt; 33), vec_list_iter_exp_out.end());
  </code></pre>
  
  <p>I would expect that if vec_list_iter_exp_out consisted of the following, hypothetical values:</p>
  
  <pre><code>vec_list_iter_exp_out[0] = 5, 22, 9
  vec_list_iter_exp_out[1] = 12, 31, 54
  vec_list_iter_exp_out[2] = 17, 42, 0
  vec_list_iter_exp_out[3] = 253, 3, 5
  vec_list_iter_exp_out[4] = 65, 110, 24
  </code></pre>
  
  <p>That the entirety of vec_list_iter_exp_out[2] and vec_list_iter_exp_out [4] would be removed and vec_list_iter_exp_out would then consist of the following:</p>
  
  <pre><code>vec_list_iter_exp_out[0] = 5, 22, 9
  vec_list_iter_exp_out[1] = 12, 31, 54
  vec_list_iter_exp_out[2] = 253, 3, 5
  </code></pre>
  
  <p>Instead I get the aforementioned compile error.</p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <p>Edit: definition of the vector in question, as requested.</p>
  
  <pre><code>struct TriStore
  {
      double j,k,l;
  };
  
  std::vector&lt;TriStore&gt; vec_list_iter_exp_out;
  </code></pre>
  
  <p>and snippet for insertion (obviously references other functions and what-have-you, but that would take up far too much space)</p>
  
  <pre><code>    for(int z = 1; z &lt;= iters; z++)
      {
          vec_iters.push_back(vec_list_iter_exp_out.size());
          for(int i = vec_iters[z-1]; i &lt; vec_iters[z]; i++)
          {
              if(vec_list_iter_exp_out[i].k &lt; kk)
              {
                  triangle_list(vec_list_iter_exp_out[i].j,vec_list_iter_exp_out[i].k,vec_list_iter_exp_out[i].l);
                  vec_list_iter_exp_out.insert(vec_list_iter_exp_out.end(),vec_tri_list.begin(),vec_tri_list.end());
              }
          }
      }
  </code></pre>