LWN.net Logo

Generic red-black trees

Generic red-black trees

Posted Jun 8, 2012 5:15 UTC (Fri) by quotemstr (subscriber, #45331)
Parent article: Generic red-black trees

And hacky macros are better than C++ templates or code generaton why, exactly? I'm all for using the C preprocessor, but there comes a time when enough is enough and the best option is metaprogramming.


(Log in to post comments)

Generic red-black trees

Posted Jun 8, 2012 8:49 UTC (Fri) by przemoc (subscriber, #67594) [Link]

> And hacky macros are better than C++ templates or code generaton why, exactly?

Who said they are? And it's irrelevant here.

> I'm all for using the C preprocessor, but there comes a time when enough is enough and the best option is metaprogramming.

These CPP macros actually allow some kind of poor metaprogramming. It goes without saying that C++ templates are quite powerful as turing complete system, but...

Check a bit old LKML FAQ, if you have forgotten about the context.

Section 15 - Programming Religion
3. Why don't we rewrite the Linux kernel in C++?
http://www.tux.org/lkml/#s15-3

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds