Skip to content

Commit ae50ea8

Browse files
committed
[coro_io] add random engine
1 parent 1985649 commit ae50ea8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

include/ylt/util/random.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <random>
2+
namespace ylt::util {
3+
template <typename engine_type = std::default_random_engine>
4+
inline engine_type& random_engine() {
5+
static thread_local std::default_random_engine e(std::random_device{}());
6+
return e;
7+
}
8+
} // namespace ylt::util

0 commit comments

Comments
 (0)