Este sitio web funciona mejor con JavaScript.
Inicio
Explorar
Ayuda
Iniciar sesión
felix
/
ftb
Seguir
1
Destacar
0
Fork
0
Código
Incidencias
0
Pull Requests
0
Lanzamientos
0
Wiki
Actividad
Explorar el Código
arraylsits can now reserve
banana-cakes
Felix Brendel
hace 6 años
padre
635af49d52
commit
7d8eabf479
Se han
modificado 1 ficheros
con
7 adiciones
y
0 borrados
Dividir vista
Opciones de diferencias
Mostrar estadísticas
Descargar archivo de parche
Descargar archivo de diferencias
+7
-0
arraylist.hpp
+ 7
- 0
arraylist.hpp
Ver fichero
@@ -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];
}
Escribir
Vista previa
Cargando…
Cancelar
Guardar