I want to use the uniform_int_distribution in the c++ random library. However, it only does the sampling with replacement, as in the example below. How can I sample without replacement?
#include <iostream>
#include <random>
int main()
{
std::default_random_engine generator;
std::uniform_int_distribution<int> distribution(1,4);
for(int i=0; i<4; ++i)
std::cout << distribution(generator) << std::endl;
return 0;
}