30 lines
874 B
C++
30 lines
874 B
C++
#pragma once
|
|
#include "../../stdint.hpp"
|
|
|
|
static constexpr int8_t operator""_i8(unsigned long long int value) {
|
|
return static_cast<int8_t>(value);
|
|
}
|
|
|
|
static constexpr uint8_t operator""_u8(unsigned long long int value) {
|
|
return static_cast<uint8_t>(value);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr int16_t operator""_i16(unsigned long long int value) {
|
|
return static_cast<int16_t>(value);
|
|
}
|
|
|
|
static constexpr uint16_t operator""_u16(unsigned long long int value) {
|
|
return static_cast<uint16_t>(value);
|
|
}
|
|
|
|
// ###################################################################
|
|
|
|
static constexpr int32_t operator""_i32(unsigned long long int value) {
|
|
return static_cast<int32_t>(value);
|
|
}
|
|
|
|
static constexpr uint32_t operator""_u32(unsigned long long int value) {
|
|
return static_cast<uint32_t>(value);
|
|
} |