It's functionally blackbox compatible with the STL for the major containers. Unless you're writing heap spaced firmware where C++ with an STL isn't available I recommend you just use modern day C++.
Unless, of course, you want blazing fast compile times!
#include <stdio.h>
#define P
#define T int
#include <vec.h>
int compare(int* a, int* b) { return *b < *a; }
int main(void)
{
vec(int) a = vec_init(int)();
vec_push_back(int)(&a, 9);
vec_push_back(int)(&a, 1);
vec_push_back(int)(&a, 8);
vec_push_back(int)(&a, 3);
vec_push_back(int)(&a, 4);
vec_sort(int)(&a, compare);
foreach(vec(int), &a, it)
printf("%d\n", *it.ref);
vec_free(int)(&a);
}
I really should finish that writeup some day.CTL
#define P
#define T int
#include <vec.h>
STL #include <vector>
template class std::vector<int>;
C++ with its STL is just dramatically slower at compiling it all. C loves to chew through its basic syntax and O(1) lookup since every symbol is essentially unique (take that C++ and your function overloading!)1. Operating on intrusive containers requires no heap operations, all control structures are preallocated. This is golden, and in more ways than one.
2. Keeping an item in multiple containers has the exact same semantics as storing it in just one. With STL it requires switching from storing items to storing pointers to them. Meaning that you can't throw foo from an existing list into some extra map without reworking all list-related code.