If not using C++, the best solution is to put the template body in an unguarded include file.
Then, to instantiate the template, you do something like this:
#define NAME foo
#define T foo_t
#define U bar_t
(with the header #undefining those macros)
This allows to implement the code without huge multiline macros and horrible trailing continuation backslashes.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds