4#include "../Foundation/PrimitiveTypes.h"
23 constexpr T SignedMaxValue()
const
26 return (~0) & ~static_cast<T>((1ull << (
sizeof(T) * 8 - 1)));
29 constexpr T UnsignedMaxValue()
const
31 return static_cast<T
>(~0ull);
34 constexpr operator uint8_t()
const {
return UnsignedMaxValue<uint8_t>(); }
35 constexpr operator uint16_t()
const {
return UnsignedMaxValue<uint16_t>(); }
36 constexpr operator uint32_t()
const {
return UnsignedMaxValue<uint32_t>(); }
37 constexpr operator uint64_t()
const {
return UnsignedMaxValue<uint64_t>(); }
38#if SC_COMPILER_MSVC == 0 && SC_COMPILER_CLANG_CL == 0 && !SC_PLATFORM_LINUX
39 constexpr operator size_t()
const {
return UnsignedMaxValue<size_t>(); }
42 constexpr operator int8_t()
const {
return SignedMaxValue<int8_t>(); }
43 constexpr operator int16_t()
const {
return SignedMaxValue<int16_t>(); }
44 constexpr operator int32_t()
const {
return SignedMaxValue<int32_t>(); }
45 constexpr operator int64_t()
const {
return SignedMaxValue<int64_t>(); }
46#if SC_COMPILER_MSVC == 0 && SC_COMPILER_CLANG_CL == 0 && !SC_PLATFORM_LINUX
47 constexpr operator ssize_t()
const {
return SignedMaxValue<ssize_t>(); }
51 constexpr operator float()
const {
return 3.402823466e+38F; }
52 constexpr operator double()
const {
return 1.7976931348623158e+308; }
54 constexpr operator float()
const {
return 3.40282347e+38F; }
55 constexpr operator double()
const {
return 1.7976931348623157e+308; }
int int32_t
Platform independent (4) bytes signed int.
Definition: PrimitiveTypes.h:46
unsigned char uint8_t
Platform independent (1) byte unsigned int.
Definition: PrimitiveTypes.h:36
unsigned long long uint64_t
Platform independent (8) bytes unsigned int.
Definition: PrimitiveTypes.h:42
signed char int8_t
Platform independent (1) byte signed int.
Definition: PrimitiveTypes.h:44
long long int64_t
Platform independent (8) bytes signed int.
Definition: PrimitiveTypes.h:50
unsigned long size_t
Platform independent unsigned size type.
Definition: PrimitiveTypes.h:56
unsigned int uint32_t
Platform independent (4) bytes unsigned int.
Definition: PrimitiveTypes.h:38
short int16_t
Platform independent (2) bytes signed int.
Definition: PrimitiveTypes.h:45
unsigned short uint16_t
Platform independent (2) bytes unsigned int.
Definition: PrimitiveTypes.h:37
signed long ssize_t
Platform independent signed size type.
Definition: PrimitiveTypes.h:57
An object that can be converted to any primitive type providing its max value.
Definition: Limits.h:21