title: Create C++ discrete distribution from list
body: <p>I am trying to create a std::discrete_distribution:</p>
  
  <p><a href="http://en.cppreference.com/w/cpp/numeric/random/discrete_distribution" rel="nofollow noreferrer">http://en.cppreference.com/w/cpp/numeric/random/discrete_distribution</a></p>
  
  <p>All the examples I have seen define it like in the link above <code>std::discrete_distribution&lt;&gt; d({40, 10, 10, 40});</code></p>
  
  <p>But instead of <code>{40, 10, 10, 40}</code> I would like to do this programmatically, rather than hardcoded.</p>