Add pcg::random::uniform_distribution<T> that selects between int and real
This commit is contained in:
parent
e7e419a931
commit
eb5577909a
1 changed files with 14 additions and 0 deletions
14
libs/pcg/include/psemek/pcg/random/uniform.hpp
Normal file
14
libs/pcg/include/psemek/pcg/random/uniform.hpp
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <psemek/pcg/random/uniform_int.hpp>
|
||||||
|
#include <psemek/pcg/random/uniform_real.hpp>
|
||||||
|
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
namespace psemek::pcg
|
||||||
|
{
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
using uniform_distribution = std::conditional_t<std::is_floating_point_v<T>, uniform_real_distribution<T>, uniform_int_distribution<T>>;
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue