mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 02:55:45 +00:00
Move dead submodules in-tree
Signed-off-by: swurl <swurl@swurl.xyz>
This commit is contained in:
parent
c0cceff365
commit
6c655321e6
4081 changed files with 1185566 additions and 45 deletions
27
externals/dynarmic/tests/rand_int.h
vendored
Normal file
27
externals/dynarmic/tests/rand_int.h
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
/* This file is part of the dynarmic project.
|
||||
* Copyright (c) 2020 MerryMage
|
||||
* SPDX-License-Identifier: 0BSD
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <random>
|
||||
#include <type_traits>
|
||||
|
||||
namespace detail {
|
||||
inline std::mt19937 g_rand_int_generator = [] {
|
||||
std::random_device rd;
|
||||
std::mt19937 mt{rd()};
|
||||
return mt;
|
||||
}();
|
||||
} // namespace detail
|
||||
|
||||
template<typename T>
|
||||
T RandInt(T min, T max) {
|
||||
static_assert(std::is_integral_v<T>, "T must be an integral type.");
|
||||
static_assert(!std::is_same_v<T, signed char> && !std::is_same_v<T, unsigned char>,
|
||||
"Using char with uniform_int_distribution is undefined behavior.");
|
||||
|
||||
std::uniform_int_distribution<T> rand(min, max);
|
||||
return rand(detail::g_rand_int_generator);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue