This commit is contained in:
Mars 2024-06-21 03:34:33 -04:00
parent b09839ff6a
commit 269122d30c
Signed by: pupbrained
GPG key ID: 0FF5B8826803F895
10 changed files with 68 additions and 69 deletions

View file

@ -1,11 +1,11 @@
#pragma once
#include <stdexcept>
#include <string>
#include <utility>
#include <variant>
#include "macros.h"
#include "types.h"
/**
* @class Error
@ -19,16 +19,16 @@ class Error {
* @brief Constructs an Error with a message.
* @param message The error message.
*/
explicit Error(std::string message) : m_Message(std::move(message)) {}
explicit Error(string message) : m_Message(std::move(message)) {}
/**
* @brief Retrieves the error message.
* @return A constant reference to the error message string.
*/
[[nodiscard]] fn message() const -> const std::string& { return m_Message; }
[[nodiscard]] fn message() const -> const string& { return m_Message; }
private:
std::string m_Message; ///< The error message.
string m_Message; ///< The error message.
};
// Primary template for Result with a default type of void

View file

@ -2,6 +2,7 @@
#include <cstddef>
#include <cstdint>
#include <string>
/**
* @typedef u8
@ -117,3 +118,10 @@ using usize = std::size_t;
* subtracting two pointers.
*/
using isize = std::ptrdiff_t;
/**
* @typedef string
* @brief Represents a string.
*/
using string = std::string;