4 ms·
Wait ... "imagine" - you can't currently do more than one? That's kind of the essential point with templates. (I scrolled through it and assumed you'd just do
by eqvinox 6y ago
Wait ... "imagine" - you can't currently do more than one? That's kind of the essential point with templates.
(I scrolled through it and assumed you'd just do "#define lst list_charp"?)
- gpderetta 6y agoit seems that it "instantiates" two list types: lst_charp and lst_point and uses both of them. What's the issue?
- deleted 6y ago[deleted]
- wffurr 6y ago“Imagine” as in that code is written in an HN comment, not a C source file, and probably hasn’t been checked with a compiler yet. Why don’t you copy and paste it into a test, try it out, and report back?
- glouwbug 6y agoYes, as many templates as you like. An A* pathfinder, for instance: https://github.com/glouw/ctl/blob/master/examples/astar.c#L84 https://github.com/glouw/ctl/blob/master/examples/astar.c#L8... Although if you're interested in just a batch rename, it's something like this: #define vec_char str #define P #define T char #include <vec.h>