[Glacier] Add the [] operator to string.

This commit is contained in:
Drew Galbraith 2023-10-24 12:34:52 -07:00
parent 990dd4c1e1
commit ca5361b847
2 changed files with 7 additions and 0 deletions

View file

@ -38,4 +38,9 @@ bool String::operator==(const String& other) {
return true;
}
char String::operator[](uint64_t offset) const {
// FIXME: bounds check.
return cstr_[offset];
}
} // namespace glcr