
19 Oct
2006
19 Oct
'06
2:01 p.m.
Peter Dimov escreveu:
Terry G wrote:
I've just finished reading C++ Template Metaprogramming again. I just don't get it.
Why would someone use a type container?
Imagine a case where for some reason you would like to call
register
(); for all combinations of X1..Xm and Y1..Yn. Writing the calls by hand gets tedious. If you put Xi and Yi in type sequences, you can write a metaprogram that generates the calls.
I have to say this is probably the most convincing example I've seen since the last time I read that tutorial thing about representing physical quantities. -- Pedro LamarĂ£o