#include #define VEC_TYPE int #define VEC_NAME ints #include int main() { struct ints ints = ints_create(0); for (int i = 0; i < 1000000; ++i) { ints_append(&ints, i); } assert(ints_len(&ints) == 1000000); for (int i = 0; i < 1000000; ++i) { int *v = ints_at(&ints, i); assert(v && *v == i); } int i = 0; foreach(ints, iter, &ints) { assert(iter && *iter == i); i++; } for (int i = 1000000 - 1; i >= 0; --i) { ints_remove(&ints, i); } assert(ints_len(&ints) == 0); ints_destroy(&ints); }