Dave Whipp <[EMAIL PROTECTED]> wrote:

> C does do templates, sort-of:

> #define STACK_TYPE int
> #define STACK_MAX_SIZE 1024
> #include stack_template_decl.h
> #include stack_template_impl.h
> #undef STACK_TYPE
> #undef STACK_MAX_SIZE

> There can be some issues debugging this stuff though:

And this is the big problem with it.

I think, we should have a general stack engine which just knows about
item size and chunk size. The base functions return a (void *) to an
entry.
The fast paths (now chunk add/del needed) could even be inlined. A
separate handling of the entries like in stacks.c could be on top of
this.

> Dave.

leo

Reply via email to