refactor(furvm): move bad access exceptions to exceptions.hpp

Refs: #12
This commit is contained in:
2026-06-19 14:26:09 +02:00
parent 5a1b7c5aa6
commit 65e5fdf324
3 changed files with 73 additions and 72 deletions
+1 -33
View File
@@ -2,6 +2,7 @@
#define FURVM_THING_HPP
#include "furlang/arena.hpp"
#include "furvm/exceptions.hpp"
#include "furvm/fwd.hpp"
#include <cstddef>
@@ -30,39 +31,6 @@ static inline std::size_t thing_type_size(thing_t type) {
}
}
class bad_thing_access : public std::exception {
public:
bad_thing_access() = default;
~bad_thing_access() override = default;
/**
* @brief Move constructor.
*/
bad_thing_access(bad_thing_access&&) noexcept = default;
/**
* @brief Move constructor.
*/
bad_thing_access& operator=(bad_thing_access&&) noexcept = default;
/**
* @brief Copy constructor.
*/
bad_thing_access(const bad_thing_access&) = default;
/**
* @brief Copy constructor.
*/
bad_thing_access& operator=(const bad_thing_access&) = default;
public:
/**
* @brief Returns a C-style string describing the cause of the error.
*
* @return The cause of the error.
*/
const char* what() const noexcept override { return "bad thing access"; }
};
template <template <typename> typename Allocator>
class thing final {
friend class executor;