Skip to content

Commit b2e66b1

Browse files
committed
Add suffle method overload
1 parent 2001b38 commit b2e66b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/xtd.core/include/xtd/random.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ namespace xtd {
235235
shuffle(span_values);
236236
return values;
237237
}
238+
/// @brief Performs an in-place shuffle of an array.
239+
/// @param values The array to shuffle.
240+
template<class collection_t>
241+
collection_t shuffle(const collection_t& values) const {
242+
auto result = values;
243+
shuffle(result);
244+
return result;
245+
}
238246
/// @}
239247

240248
protected:

0 commit comments

Comments
 (0)