使用 JavaScript能使本网站更好的工作。
首页
探索
帮助
登录
felix
/
ftb
关注
1
点赞
0
派生
0
代码
工单
0
合并请求
0
版本发布
0
百科
动态
浏览代码
arraylsits can now reserve
banana-cakes
Felix Brendel
6 年前
父节点
635af49d52
当前提交
7d8eabf479
共有
1 个文件被更改
,包括
7 次插入
和
0 次删除
分列视图
Diff 选项
显示统计
下载 Patch 文件
下载 Diff 文件
+7
-0
arraylist.hpp
+ 7
- 0
arraylist.hpp
查看文件
@@ -51,6 +51,13 @@ struct Array_List {
next_index++;
}
void reserve(unsigned int count) {
if (next_index+count <= length) {
length *= 2;
data = (type*)realloc(data, length * sizeof(type));
}
}
type& operator[](int index) {
return data[index];
}
撰写
预览
正在加载...
取消
保存