fix: bug in Any2String

This commit is contained in:
2023-11-09 18:17:20 +08:00
parent 5ad5615586
commit 9b8b23e738
4 changed files with 28 additions and 19 deletions

View File

@ -61,9 +61,11 @@ std::string Any2String(const std::any &value) {
buf << *ptr;
else if (auto ptr = std::any_cast<std::string>(&value))
buf << *ptr;
else if (auto ptr = std::any_cast<NoneType>(&value))
buf << "None";
else
throw FatalError("Any2String: unknown type");
buf >> res;
std::getline(buf, res);
return res;
}