From 823c0b37c6d4d181a9084e1292b4610a0948b0d4 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Mon, 22 Mar 2021 18:55:21 -0500 Subject: [PATCH] Use type_traits to decide what distribution to use in Random --- include/simpleengine/random.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/simpleengine/random.h b/include/simpleengine/random.h index bb4c667..9fc6ab0 100644 --- a/include/simpleengine/random.h +++ b/include/simpleengine/random.h @@ -9,6 +9,8 @@ #include #include +#include + namespace simpleengine { template class Random { @@ -20,7 +22,8 @@ namespace simpleengine { this->gen = Generator(rd()); } - template> + template || std::is_same_v, + std::uniform_int_distribution, std::uniform_real_distribution>> T NextInRange(T min, T max) { Dist dist(min, max);