3 ms·
Are you aware of the crazy things that have been done with C++ templates? See boost spirit. It's thought-provoking, but I'm not convinced it's a good idea to us
by mtdewcmu 14y ago
Are you aware of the crazy things that have been done with C++ templates? See boost spirit. It's thought-provoking, but I'm not convinced it's a good idea to use templates this way. It seems to be too hard to exercise control over the code that gets generated, and you end up with huge binaries.
That said, metaprogramming certainly has a place, particularly when creating state machines in code (e.g. yacc, lex, re2c, ragel). It makes you wish for a standard way, but C is a conservative language, and I think that's been a key to its success.