bearophile wrote:
> Jens Mueller:
> 
> >Which makes me think Phobos is convenient enough in this use case.
> 
> I don't agree. This is not quite worse
> auto randomLetter = () => randomSample(letters, 1,
> letters.length).front;
> 
> than:
> auto randomLetter = () => letters.choice;

Then add choice explicitly.
auto choice(R)(R r) { return randomSample(r, 1, r.length).front; };

The point is that choice is a one-liner when using randomSample. It's a
special case of randomSample. But you may argue that the use case occurs
that often that it should be added. Don't know whether this is the case.

Jens

Reply via email to