このサイトはJavaScriptを使用しています
ホーム
エクスプローラー
ヘルプ
サインイン
felix
/
ftb
ウォッチ
1
スター
0
フォーク
0
コード
課題
0
プルリクエスト
0
リリース
0
Wiki
アクティビティ
ソースを参照
arraylsits can now reserve
banana-cakes
Felix Brendel
6年前
親
635af49d52
コミット
7d8eabf479
1個のファイルの変更
、
7行の追加
、
0行の削除
分割表示
差分オプション
統計情報を表示
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];
}
書き込み
プレビュー
読み込み中…
キャンセル
保存