I would like to initialize boost::random::discrete_distribution with std::vector<double> .
My problem is that if I initialize it with an array, as in the official example:
double probabilities[] = { 0.5, 0.1, 0.1, 0.1, 0.1, 0.1 }; boost::random::discrete_distribution<> dist(probabilities);
then it works fine.
However, if I initialize it with std::vector , then it behaves as if it had only one element with a probability of 1.0.
Can you tell me what is the correct way to initialize boost::random::discrete_distribution<> with a vector?
zsero source share