title: How to fill std::array with range from range-v3?
body: <p>I am a complete beginner with the range-v3 library.. Suppose I want to fill a <code>std::array</code> with random numbers in some interval. </p>
  
  <p>With iterators, I'd do something like <a href="https://stackoverflow.com/a/41154116/4686625">this answer</a>, passing iterators to my <code>std::array</code> in question as arguments. </p>
  
  <pre><code>template&lt; class Iter &gt;
  void fill_with_random_int_values( Iter start, Iter end, int min, int max)
  {
      static std::random_device rd;    // you only need to initialize it once
      static std::mt19937 mte(rd());   // this is a relative big object to create
  
      std::uniform_int_distribution&lt;int&gt; dist(min, max);
  
      std::generate(start, end, [&amp;] () { return dist(mte); });
  }
  </code></pre>
  
  <p>With the ranges library, I wanted to use <code>ranges::view::generate_n</code>, with a unary function that generates a single random number along with the size of my array.</p>
  
  <pre><code>auto random_num() -&gt; int {
    static std::mt19937 engine{std::random_device{}()};
    static std::uniform_int_distribution&lt;int&gt; dist(1, 10);
    return dist(engine);
  }
  
  std::vector&lt;int&gt; nums = ranges::view::generate_n(random_num, 10);
  </code></pre>
  
  <p>This works well for a <code>std::vector</code>, but I am rather lost on what algorithm I should be using to fill a <code>std::array</code> rather than generate a <code>std::vector</code>, as a similar approach to above does not work. I can <code>transform</code> the array and disregard each argument but that doesn't seem right. </p>