add src/coders/obj
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "../typedefs.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
@@ -47,6 +48,15 @@ namespace dynamic {
|
||||
std::holds_alternative<integer_t>(value);
|
||||
}
|
||||
|
||||
inline number_t as_number(const Value& value) {
|
||||
if (auto num = std::get_if<number_t>(&value)) {
|
||||
return *num;
|
||||
} else if (auto num = std::get_if<integer_t>(&value)) {
|
||||
return *num;
|
||||
}
|
||||
return NAN;
|
||||
}
|
||||
|
||||
class List {
|
||||
public:
|
||||
std::vector<Value> values;
|
||||
|
||||
Reference in New Issue
Block a user