refactor(furvm): refactor function

Refs: #12
This commit is contained in:
2026-06-16 12:48:16 +02:00
parent 43dac1ec6d
commit 78acfb6ee2
8 changed files with 94 additions and 81 deletions
+3 -10
View File
@@ -4,12 +4,6 @@
namespace furvm {
function::function(funkcja, function_handle id, std::size_t position, const mod_p& mod)
: m_id(id), m_type(function_t::Normal), m_module(mod), m_value(position) {}
function::function(funkcja, function_handle id, const native_function& native, const mod_p& mod)
: m_id(id), m_type(function_t::Native), m_module(mod), m_value(native) {}
function::~function() {
switch (m_type) {
case function_t::Normal:
@@ -22,7 +16,7 @@ function::~function() {
}
function::function(function&& other) noexcept
: m_id(other.m_id), m_type(other.m_type), m_module(std::move(other.m_module)) {
: m_name(std::move(other.m_name)), m_type(other.m_type) {
switch (m_type) {
case function_t::Normal: {
m_value.position = other.m_value.position;
@@ -41,9 +35,8 @@ function::function(function&& other) noexcept
function& function::operator=(function&& other) noexcept {
if (this == &other) return *this;
m_id = other.m_id;
m_type = other.m_type;
m_module = std::move(other.m_module);
m_name = std::move(other.m_name);
m_type = other.m_type;
switch (m_type) {
case function_t::Normal: {
m_value.position = other.m_value.position;