title: Setting up a Discrete Distribution in C++
body: <p>After hours of struggling with this issue, I cannot find any explanations for my error. </p>
  
  <p>I want the computer to pick a random number (weighted) between 0 and 120 (inclusive). I have an array, interval[], which holds the numbers from 0 to 120 (inclusive). I have another array, weights[], which holds the probabilities for choosing the ith element in the array. I want to define a probability distribution function for these data. </p>
  
  <p>Here is what I tried. I get an error saying that no instance of constructor matches the argument list. </p>
  
  <p>Snippet of my code: </p>
  
  <pre><code>std::vector&lt; int&gt; weights(121);
  for (int i = 0; i &lt; 121; i++)
  {
      weights[i] = (teamData[i]).S();
  }
  discrete_distribution&lt;&gt; dist(weights.begin(), weights.end());
  </code></pre>