hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/core/result.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2024-10-10 14:17:34 +0200
committerhachem <im@hachem.wtf>2024-10-10 14:17:34 +0200
commit6a3dbf44bb8056f3f4554282f092132332ac7f4a (patch)
tree686d3d8b6f40d9dd7159173bb48b049c73f5d1a3 /src/core/result.h
parent78c72c3b3e42e3e33afe6cd78ae4bc9db09a59f4 (diff)
feat: debugger interface
Diffstat (limited to 'src/core/result.h')
-rw-r--r--src/core/result.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/result.h b/src/core/result.h
new file mode 100644
index 0000000..a516336
--- /dev/null
+++ b/src/core/result.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <expected>
+#include <format>
+#include <string>
+#include <utility>
+
+namespace Hsdbg
+{
+ template <typename T>
+ using Result = std::expected<T, std::string>;
+
+ template <typename... Args>
+ auto fail(std::format_string<Args...> fmt, Args&&... args) -> std::unexpected<std::string>
+ {
+ return std::unexpected(std::format(fmt, std::forward<Args>(args)...));
+ }
+}