9 template <
typename RandomGenerator>
17 template <
typename Iter>
21 = std::uniform_int_distribution<>(0, std::distance(start, end) - 1);
22 std::advance(start, dis(
gen_));
27 template <
typename Iter>
34 template <
typename Container>
35 auto operator()(
const Container& c) -> decltype(*std::begin(c))
37 return *
select(std::begin(c), std::end(c));
41 template <
typename Container>
42 auto pop(Container& c) ->
typename Container::value_type
44 auto i =
select(std::begin(c), std::end(c));
54 template <
typename RandomGenerator>
Iter operator()(Iter start, Iter end)
A randomly selected iterator in [start, end).
random_selector(RandomGenerator &g)
random_selector< RandomGenerator > make_random_selector(RandomGenerator &g)
Iter select(Iter start, Iter end)
A randomly selected iterator in [start, end).
auto pop(Container &c) -> typename Container::value_type
A randomly selected member of c. Remove it from c.
auto operator()(const Container &c) -> decltype(*std::begin(c))
A randomly selected member of c.