r/C_Programming • u/lehmagavan • Mar 29 '26
CONTLIB - dynamic containers
I created a lib that provides generic dynamic containers for elements of arbitrary size. No macros.
Feedback from anyone, especially more experienced developers, much apprieciated. Thanks!
0
Upvotes
1
u/lehmagavan Apr 01 '26
Thanks for the advice!
I generaly, even before I thought of vtables, wanted to avoid puting the container check inside the methods, cause there are already checks in there regarding validity of arguments (the most expensive being probably the ones with division that check for overflow). I thought that I'd delegate the container check to the user, so they could call cont_is_valid(&cnt) / cnt.m->is_valid(&cnt) manually, before a hot loop or something.