Kagome
Polkadot Runtime Engine in C++17
literals.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_COMMON_LITERALS
7 #define KAGOME_COMMON_LITERALS
8 
9 namespace kagome::common::literals {
10 
11  constexpr size_t operator""_kB(long long unsigned int kilobytes) {
12  return kilobytes << 10u;
13  }
14 
15  constexpr size_t operator""_kB(long double kilobytes) {
16  return (1ull << 10) * kilobytes;
17  }
18 
19  constexpr size_t operator""_MB(long long unsigned int megabytes) {
20  return megabytes << 20u;
21  }
22 
23  constexpr size_t operator""_MB(long double megabytes) {
24  return (1ull << 20) * megabytes;
25  }
26 
27  constexpr size_t operator""_GB(long long unsigned int gigabytes) {
28  return gigabytes << 30u;
29  }
30 
31  constexpr size_t operator""_GB(long double gigabytes) {
32  return (1ull << 30) * gigabytes;
33  }
34 
35 } // namespace kagome::common::literals
36 
37 #endif // KAGOME_COMMON_LITERALS