| 134 | |
| 135 | template <typename Container, typename T, typename... TL> |
| 136 | void staticRandomShuffle(Container& container, T const& d, TL const&... rest) { |
| 137 | auto begin = container.begin(); |
| 138 | auto end = container.end(); |
| 139 | auto it = begin; |
| 140 | for (int i = 1, mix = 0; ++it != end; ++i) { |
| 141 | int off = staticRandomU32Range(0, i, ++mix, d, rest...); |
| 142 | if (off != i) |
| 143 | std::swap(*it, *(begin + off)); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | } |
no test coverage detected