CellularAutomata
Loading...
Searching...
No Matches
rng.hpp
1
#pragma once
2
3
#include "common.hpp"
4
5
#include <type_traits>
6
7
// float, double, long double
8
#define decimal typename std::enable_if<std::is_floating_point<T>::value, T>::type
9
10
// bool, char, wchar, short, int, long, long long (or extended)
11
#define integer typename std::enable_if<std::is_integral<T>::value, T>::type
12
13
namespace
CellularAutomata
14
{
20
namespace
random
21
{
27
void
seed
(
unsigned
int
seed
);
28
37
template
<
typename
T>
38
integer
random
(T min, T max);
39
48
template
<
typename
T>
49
decimal
random
(T min, T max);
50
51
}
52
}
53
54
#include "rng.inl"
CellularAutomata::random::seed
void seed(unsigned int seed)
Sets the given seed for the random number generator.
Definition
rng.inl:11
CellularAutomata::random::random
std::enable_if< std::is_integral< T >::value, T >::type random(T min, T max)
Returns a random number of given type on the range [min, max].
Definition
rng.inl:17
CellularAutomata
Main namespace.
Definition
common.hpp:33
CellularAutomata
include
core
rng.hpp
Generated by
1.9.7 and deployed by
GitHub Actions