[PATCH] Implement std::experimental::sample

Eric Fiselier eric at efcs.ca
Thu Apr 30 15:52:47 PDT 2015


Correct me if I am wrong, but as I read the standard it requires that if `_PopulationIterator` meets the requirements of `ForwardIterator` then we have to use selection sampling (because it is stable). Currently this requirement does not hold. If `_PopulationIterator` is a forward iterator and `_SampleIterator` is a random access iterator then reservoir sampling is used.

One way to fix this would be to dispatch to `__sample(...)` using either `true_type` or `false_type` instead of two iterator tags.


http://reviews.llvm.org/D9044

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list