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:
Jared Boone 2015-08-20 17:15:51 -07:00
parent 1c3e45917c
commit 4b7780f5c6
2 changed files with 10 additions and 8 deletions

View file

@ -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! */