See http://extreme.indiana.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html http://extreme.indiana.edu/~tveldhui/papers/pepm99.ps and several other papers referenced at http://www.oonumerics.org/blitz/papers/ http://www.oonumerics.org/blitz/ has a high performance math library for C++ which uses these techniques for specialization matches FORTRAN performance with clean, object-oriented interfaces.