title: Create new map from random subset of map in C++
body: <p>I have a map <code>std::map&lt;unsigned int,double&gt; areas</code> from which I would like to draw a random subset of random size (uniform distribution). So far I know how to pick a single random element. </p>
  
  <pre><code>const int range_from  = 1;
  const int range_to    = areas.size();
  std::random_device                  rand_dev;
  std::mt19937                        generator(rand_dev());
  std::uniform_int_distribution&lt;int&gt;  distr(range_from, range_to);
  std::map&lt;unsigned int,double&gt;::iterator rand_element;
  auto itrtr = ++areas.begin();
  std::advance(itrtr, distr(generator));
  unsigned int random_key = itrtr-&gt;first;
  rand_element = areas.find(random_key);
  </code></pre>
  
  <p>How would I extend this algorithm? Or would a different ansatz be better? </p>