11.07.2015 Views

Understanding C++ Expression Templates - Angelika Langer

Understanding C++ Expression Templates - Angelika Langer

Understanding C++ Expression Templates - Angelika Langer

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2Where it all started ...! Erwin Unruh's prime number program ...– does not compile, but– calculates the prime numbers at compile-time and– emits them in error messages.! works via recursive template evaluation! useful for– evaluation of expressions (vector dot product, matrix operations)– calculation of constants (square root of N, prime numbers)– evaluation of logical expression (more readable STL functors)© Copyright 1995-2000 by <strong>Angelika</strong> <strong>Langer</strong>. All Rights Reserved.http://www.<strong>Angelika</strong><strong>Langer</strong>.com(3)last update: 11/7/2005 ,21:37! compile-time computation of constant values– factorial– square root! compile-time evaluation of expressions– dot product– arithmetic expression! more examples of modern template programming– compile-time polymorphism– policy classes– template meta-programmingAgenda© Copyright 1995-2000 by <strong>Angelika</strong> <strong>Langer</strong>. All Rights Reserved.http://www.<strong>Angelika</strong><strong>Langer</strong>.com(4)last update: 11/7/2005 ,21:37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!