fix: missing None in Any2Int

This commit is contained in:
2023-11-09 20:11:29 +08:00
parent 6ae4d56a03
commit 59379a6356

View File

@ -21,8 +21,12 @@ inline ZYM::int2048 Any2Int(const std::any &value) {
str = integer_part; str = integer_part;
} }
return std::move(ZYM::int2048(str)); return std::move(ZYM::int2048(str));
} else } else if (auto ptr = std::any_cast<NoneType>(&value))
return std::move(ZYM::int2048(0));
else {
std::cerr << value.type().name() << std::endl;
throw FatalError("Any2Int2048: unknown type"); throw FatalError("Any2Int2048: unknown type");
}
} }
double Any2Float(const std::any &value) { double Any2Float(const std::any &value) {