Just assign the new distribution to a variable:
std::uniform_int_distribution<int> distr(0, 10); distr = std::uniform_int_distribution<int>(5, 13);
Or create a parameter for this (@awesomeyi answer requires creating a distribution object, it still requires creating a param_type object)
std::uniform_int_distribution<int> distr(0, 10); distr.param(std::uniform_int_distribution<int>::param_type(5, 13));
Proof that param_type will work (for @stefan):
P is the param_type associated parameter. It must satisfy the CopyConstructible, CopyAssignable and EqualityComparable requirements. It also has constructors that accept the same arguments of the same types as the D constructors, and have member functions identical to the returning parameters of the D getters
http://en.cppreference.com/w/cpp/concept/RandomNumberDistribution
dreamzor
source share