For those that don't like to use C++ templates, what do you do instead?
There is no real need to use templates (or something meta programming) at all.
If I'd need to use something classic template (like containers) while boycotting them I'd either go for a void*+per-element-size or manually expand the "template". Casting pointers is a no-op anyway.
Mayor downside being that you can't step into it in vs and that you can't include guard it..
Thinking about moving it out into another file to solve the first problem which would make the usage:
#define type int
#include "dynamic_array.c"
#undef type
since I'm only a student and working on this kinda stuff myself multiple includes aren't really a problem but I assume it wouldn't work too well on a bigger project.
For those that don't like to use C++ templates, what do you do instead?
Thanks, it is an interesting reply. I agree there is no need, but it *is* convenient at times. I wonder if languages where templates are implemented better, and don't cause compile time issues lead people to be more productive, or if easy access to templates lead us to make things overly complicated.
I know we toss them around constantly in our C# web code for collections and it would certainly be cumbersome to have to deal with those by hand.