title: Permutation algorithm C++
body: <p>I try to translate an algorithm that generates all permutations of k out of n in C++ :</p>
  
  <pre><code>public void calculerEquipeTOT(ArrayList&lt;Nageur&gt; L, ArrayList&lt;Nageur&gt; F, int k) {
  
      if (k == 0) {
          if (calculerPointsTOT(L) &gt; this.pointsMeilleureEquipe){
              this.meilleureEquipe = L;
              this.pointsMeilleureEquipe = calculerPointsTOT(meilleureEquipe);
          }
      } else {
          for (Nageur x : F) {
              ArrayList&lt;Nageur&gt; G = new ArrayList&lt;Nageur&gt;(F);
              G.remove(G.indexOf(x));
              ArrayList&lt;Nageur&gt; L2 = new ArrayList&lt;Nageur&gt;(L);
              L2.add(x);
              calculerEquipeTOT(L2, G, k - 1);
          }
      }
  }
  </code></pre>
  
  <p>My problem is that the Lists could be Objects list and I don't know how to remove the x of the L2 list... I am not a C++ specialist, I managed it in Java but I have to do it in C++. </p>