LuaState tovalue, pushvalue for dynamic::Value

This commit is contained in:
MihailRis
2024-04-01 00:04:10 +03:00
parent 8950f4ecd5
commit 75a7b89fc8
9 changed files with 126 additions and 31 deletions
+8
View File
@@ -353,6 +353,10 @@ Value::~Value() {
}
}
Value Value::of(bool value) {
return Value(valtype::boolean, value);
}
Value Value::of(number_u value) {
if (std::holds_alternative<integer_t>(value)) {
return Value(valtype::integer, std::get<integer_t>(value));
@@ -360,3 +364,7 @@ Value Value::of(number_u value) {
return Value(valtype::number, std::get<number_t>(value));
}
}
Value Value::of(const std::string& value) {
return Value(valtype::string, value);
}