aboutsummaryrefslogtreecommitdiff
path: root/libk
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-03-21 16:53:07 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-03-21 16:53:07 +0200
commite9232199bdd97233dabd59f07c63607c93c0c59c (patch)
tree66aff19650079c9fc990f75d2ed390dd674cfdaa /libk
parentAdd allocator (diff)
downloadkernel.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.h5
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;
};