We all know the usual use of templates to design containers and we all know that you can do things with templates that will make your head spin.
When I first encoutered static polymorphism I was really struck on what you can do with templates. It's obvious that templates are useful for more than for designing containers. I bought Andrei's "Modern C+ Design" but sadly haven't yet found the time or concentration to read it but I'm sure it offers a wealth of brilliant uses of templates.
IMHO this is also a very clever use of templates.
What's the most ingenious use of templates you've ever encountered?