wawa
This commit is contained in:
parent
b09839ff6a
commit
269122d30c
10 changed files with 68 additions and 69 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue