The differences with STC, M*LIB, and CC are not cosmetic. They change
what writing a C file feels like.
01 / API parity
C++ STL names. Same semantics.
push_back, insert, begin/end,
rbegin/rend, next/prev, first/second
— they all mean what a C++ programmer expects them to mean.
push_back(v, 42);
insert(m, 1, "one");
rbegin(m);
it->first;
02 / Distribution
One header. Zero codegen.
Drop opencstl.h in. Done. No
#define TYPE int ritual, no template instantiation
file, no per-type forward declarations cluttering the top of
your translation unit.
#include "opencstl.h"
// that's it.
03 / Uniformity
One function name, every container.
push_back works on vector, list,
deque. insert works on every container that
can take an insert. No prefix soup. No name suffixes.
push_back(vec, x);
push_back(list, y);
push_back(deq, z);
04 / Interop
Plays with qsort and bsearch.
v[i] and q[i] are real array accesses —
vector and deque both subscript like
plain C arrays. That means the C standard library still works —
pass containers to qsort, bsearch,
anywhere that takes a pointer and a size.
qsort(v, size(v),
sizeof(char*),
LESS(char*));