[PATCH] Implement std::experimental::sample

Evgeniy Stepanov eugenis at google.com
Wed Apr 29 13:13:16 PDT 2015


On Tue, Apr 28, 2015 at 6:09 AM, Marshall Clow <mclow.lists at gmail.com> wrote:
> - SampleIterator shall meet the additional requirements of a RandomAccessIterator type
>
> unless PopulationIterator meets the additional requirements of a ForwardIterator
> type.
>
> So if I call `sample(InputIterator, InputIterator, ForwardIterator, 1, rnd)`, I should get a compile error.

You probably meant sample(InputIterator, InputIterator,
OutputIterator, 1, rnd) ? I've added a test for that.

But this "unless" does not forbid both sides to be true, does it? I mean
sample(ForwardIterator, ForwardIterator, RandomAccessIterator) should work.

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



More information about the cfe-commits mailing list