mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-28 17:24:50 -04:00
Move _KiB and _MiB user-defined literals to utility.hpp.
Where I put all the stuff I don't know where to put.
This commit is contained in:
parent
1c3e45917c
commit
4b7780f5c6
2 changed files with 10 additions and 8 deletions
|
@ -32,6 +32,14 @@
|
|||
|
||||
#define LOCATE_IN_RAM __attribute__((section(".ramtext")))
|
||||
|
||||
constexpr size_t operator "" _KiB(unsigned long long v) {
|
||||
return v * 1024;
|
||||
}
|
||||
|
||||
constexpr size_t operator "" _MiB(unsigned long long v) {
|
||||
return v * 1024 * 1024;
|
||||
}
|
||||
|
||||
template<typename E>
|
||||
constexpr typename std::underlying_type<E>::type toUType(E enumerator) noexcept {
|
||||
/* Thanks, Scott Meyers! */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue