diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-21 16:53:07 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-21 16:53:07 +0200 |
commit | e9232199bdd97233dabd59f07c63607c93c0c59c (patch) | |
tree | 66aff19650079c9fc990f75d2ed390dd674cfdaa /libk | |
parent | Add allocator (diff) | |
download | kernel.cpp-e9232199bdd97233dabd59f07c63607c93c0c59c.tar.xz |
Check multiboot2 header length, and if needed map the next page as well
Diffstat (limited to 'libk')
-rw-r--r-- | libk/result.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libk/result.h b/libk/result.h index 8077baf..e940bd9 100644 --- a/libk/result.h +++ b/libk/result.h @@ -7,6 +7,7 @@ template <typename T, error_enum_t E> class Result { public: + constexpr Result() = default; explicit constexpr Result(T t) : is_ok(true), data{.t = t} {}; explicit constexpr Result(E e) : is_ok(false), data{.e = e} {}; @@ -15,9 +16,9 @@ public: constexpr T value() const { return is_ok ? data.t : T{}; } private: - const bool is_ok; + const bool is_ok = false; union { T t; - E e; + E e = E::NoError; } data; }; |