title: Trying to pair 2 items from a vector but use them only once
body: <p>I'm not sure how descriptive my title is but hopefully some clicked and will better understand what I mean here.</p>
  
  <p>I am making a simple game and the function that I want to create should take an item from an array (name) and one from the other (role) and pair them together to form "name-role" which will be added in the other vector.</p>
  
  <p>My first version had me trying to use rand() with all numbers under 13 but I found myself having to wait around 30 minutes after the first 6 items because, obviously, it would take some time until it would get another index that wasn't already used. I tried to use some vectors with items, extract random number from them and then delete that number so it will be much faster but it's stuck in a loop and I'm not really sure why. I worked on this for a long time and started getting very confused and tired from my own code, so if someone could help me that'd be great.</p>
  
  <p>My current non-working code:</p>
  
  <pre><code>std::vector&lt;std::string&gt; gGetResidents()
  {
      std::string gPlayers[12]{ "Deodat Lawson", "James Bayley", "Edward Bishop", "Rebecca Nurse", "Sarah Good",
      "Bridget Bishop", "Sarah Wildes", "Elizabeth Howe", "John Proctor", "Martha Carrier", "George Burroughs",
      "Giles Corey" };
  
      std::string gRoles[12]{ "Jailor", "Sheriff", "Investigator", "Vigilante", "Doctor", "Bodyguard", "Lookout",
      "Escort", "Godfather", "Mafioso", "Consort", "Framer" };
  
      std::vector&lt;size_t&gt; gUsed;
  
      std::vector&lt;std::string&gt; gMetaResidents;
  
      for (size_t gInd{ 0 }; gInd &lt; 12; ++gInd)
      {
      gLabel:
  
          std::vector&lt;size_t&gt; gNumbersPlayer{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
  
          std::vector&lt;size_t&gt; gNumbersRole{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
  
          srand(time(nullptr));
          size_t gRandomPositionPlayer = rand() % gNumbersPlayer.size();
          size_t gRandomPositionRole = rand() % gNumbersRole.size();
  
          std::cout &lt;&lt; "siz : " &lt;&lt; gNumbersPlayer.size() &lt;&lt; "\n\n";
  
          std::cout &lt;&lt; "rand pos pl : " &lt;&lt; gRandomPositionPlayer &lt;&lt; " rand pos rol : " &lt;&lt; gRandomPositionRole &lt;&lt; "\n\n";
  
          size_t gRandomPlayer{ 0 };
          size_t gRandomRole{ 0 };
  
          if(gRandomPositionPlayer &lt; gNumbersPlayer.size() &amp;&amp; std::find(gNumbersPlayer.begin(), gNumbersPlayer.end(), gRandomPositionPlayer) != gNumbersPlayer.end())
          {
              gRandomPlayer = gNumbersPlayer[gRandomPositionPlayer -1];
              gNumbersPlayer.erase(gNumbersPlayer.begin() + gRandomPositionPlayer);
          }
  
          std::cout &lt;&lt; "rand pl : " &lt;&lt; gRandomPlayer;
  
          if (gRandomPositionRole &lt; gNumbersRole.size() &amp;&amp; std::find(gNumbersRole.begin(), gNumbersRole.end(), gRandomPositionRole) != gNumbersRole.end())
          {
              gRandomRole = gNumbersRole[gRandomPositionRole - 1];
              gNumbersRole.erase(gNumbersRole.begin() + gRandomPositionRole);
          }
  
          std::cout &lt;&lt; " rand rol : " &lt;&lt; gRandomRole &lt;&lt; "\n\n";
  
          if (std::find(gUsed.begin(), gUsed.end(), gRandomPlayer) != gUsed.end())
              goto gLabel;
  
          if (std::find(gUsed.begin(), gUsed.end(), gRandomRole) != gUsed.end())
              goto gLabel;
  
          gUsed.push_back(gRandomPlayer);
          gUsed.push_back(gRandomRole);
  
          std::string gCombinedUn = gPlayers[gRandomPlayer].append(" is the ");
          std::string gCombined = gCombinedUn.append(gRoles[gRandomRole]);
  
          gMetaResidents.push_back(gCombined);
  
          gCombinedUn.clear();
          gCombined.clear();
  
          std::cout &lt;&lt; gRandomPlayer &lt;&lt; " - " &lt;&lt; gRandomRole &lt;&lt; "\n";
      }
  
      return gMetaResidents;
  }
  </code></pre>
  
  <p>P.S.: The couts are from me trying to debug the game (despite being able to do it from my IDE, I just prefer doing this for some odd reason, so, ignore them.</p>