Can someone explain what is the benefit of this, and when it is good to
employ Template Metaprogramming?
I think there is a good answer for this in Alexanrescu's "Modern C++
Design".
Reagrds,
Vyacheslav
TMP is most useful when you want to impress others and show them how
smart and clever you are. No practical use of TMP is known yet (not
even at Boost).
We get it. You don't like templates.
PLONK.
As for me, I like templates. But if I have a choice between two solutions, I
prefer the more flexible and explicit one.
ben
I don't like bloat, macro-, OO-, and template-bloat. OTOH, I like (a)
KISS.
Ok, ok, we know (and don't care) that you don't like templates - you've been serial-trolling this ng long enough that we
get the point.
> No practical use of TMP is known yet (not
> even at Boost).
Not so; here's one:
http://www.oonumerics.org/blitz/
It is big and it is clever.
--
Lionel B
Have you ever used that beast? I have. It makes your life a lot easier. You
come to work, make changes to your program, type 'make' and you are free
for the rest of the day. If the boss asks, "it's compiling".
Yup, some while ago.
> It makes your life a lot
> easier. You come to work, make changes to your program, type 'make'
> and you are free for the rest of the day. If the boss asks, "it's
> compiling".
:-)
Don't know what compiler you use... it's not quite so bad as I remember it.
--
Lionel B
Hi.
In game development it's sometimes useful to have consts for some sin,
cos and other values. And speed is of course highest priority. If you
don't want to use paper math tables you can write your own trigonometric
functions as meta templates and use any const value you want. It will
calculate at compile time. It may be useful :-)
misiek