Convert Dictionary types to be templated classes

This has the fortunate side-effect of also making it so we can store
the value objects as typed pointers, instead of void*.
This commit is contained in:
Tim Wojtulewicz 2022-06-27 14:22:21 -07:00
parent 15c0bd9b9d
commit 47e7fe2cd1
15 changed files with 1153 additions and 1284 deletions

View file

@ -65,7 +65,7 @@ public:
// For the current iteration, returns the corresponding value.
ZVal IterValue()
{
auto tev = (*tbl_iter)->GetValue<TableEntryVal*>();
auto tev = (*tbl_iter)->value;
return ZVal(tev->GetVal(), aux->value_var_type);
}
@ -88,8 +88,8 @@ private:
// Associated auxiliary information.
ZInstAux* aux = nullptr;
std::optional<DictIterator> tbl_iter;
std::optional<DictIterator> tbl_end;
std::optional<DictIterator<TableEntryVal>> tbl_iter;
std::optional<DictIterator<TableEntryVal>> tbl_end;
};
// Class for simple step-wise iteration across an integer range.