aboutsummaryrefslogtreecommitdiffstats
path: root/util/random/easy.h
blob: 275d1607106e7e617146b20d031243418f7525d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once

#include "random.h"

namespace NPrivate {
    struct TRandom {
        inline operator unsigned char() {
            return RandomNumber<unsigned char>();
        }

        inline operator unsigned short() {
            return RandomNumber<unsigned short>();
        }

        inline operator unsigned int() {
            return RandomNumber<unsigned int>();
        }

        inline operator unsigned long() {
            return RandomNumber<unsigned long>();
        }

        inline operator unsigned long long() {
            return RandomNumber<unsigned long long>();
        }

        inline operator bool() {
            return RandomNumber<bool>();
        }

        inline operator float() {
            return RandomNumber<float>();
        }

        inline operator double() {
            return RandomNumber<double>();
        }

        inline operator long double() {
            return RandomNumber<long double>();
        }
    };
}

static inline ::NPrivate::TRandom Random() noexcept { 
    return {};
}