Skip to content

Commit

Permalink
Add items method to strarr
Browse files Browse the repository at this point in the history
  • Loading branch information
aarikpokras authored Dec 16, 2024
1 parent 71f6d99 commit d36395f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/io.cxlbund/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ struct strarr {
str whatf = str(what);
c.push_back(whatf.c[0]);
}
num<int> items() {
std::string ret__ = std::to_string(c.size());
int ret_ = std::stoi(ret__);
return num(ret_);
}
str operator[](const num<int>& o) {
std::string ret_ = c[o.c];
return str(ret_);
Expand Down

0 comments on commit d36395f

Please sign in to comment.