title: How to set a vector of "discrete_distribution" c++
body: <p>I'm trying to make a simulation of something like a Markov chain
  and using discrete_distribution to simulate the change of state s_i to s_j.
  But of course, this is a Matrix, not a vector.
  So I try.</p>
  
  <pre><code>std::vector &lt;uint16_t&gt; v {{...},
                            {...},
                             ...
                            {...},};
  
  std::vector &lt;std::discrete_distribution &lt;uint16_t&gt; &gt; distr(n, std::distribution &lt;uint16_t&gt; (v.begin(), v.end()) );
  </code></pre>
  
  <p>but this doesn't work.</p>
  
  <p><strong>note: if I try just 1 vector, this is a vector of uint16_t works</strong></p>
  
  <pre><code>// CHANGE v by v[0]
  std::vector&lt;std::discrete_distribution &lt;uint64_t&gt;&gt; distr(1, std::discrete_distribution &lt;uint64_t&gt; (vecs[0].begin(), vecs[0].end()));
  </code></pre>
  
  <p>based on this <a href="https://stackoverflow.com/questions/7904132/how-to-initialize-boostrandomdiscrete-distribution-using-stdvector">answer</a> </p>
  
  <p>I know that </p>
  
  <pre><code>std::vector &lt;std::discrete_distribution &lt;uint16_t&gt; &gt; distr(n, std::distribution &lt;uint16_t&gt; (v.begin(), v.end()) );
  </code></pre>
  
  <p>is not correct, but I say about the change v1 to v. to demonstrate that is possible use a vector of discrete distributions</p>