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.

19Composite and InterpreterThe dot product example is a degenerated form of aComposite because! every Composite consists of exactly one Leaf and and oneComposite, and! there is only one type of Leaf and one type of Composite.The Interpreter pattern is a related pattern.! The syntax tree in the Interpreter pattern is a Composite.Let us discuss alternative implementations of the Interpreterpattern.© Copyright 1995-2000 by <strong>Angelika</strong> <strong>Langer</strong>. All Rights Reserved.http://www.<strong>Angelika</strong><strong>Langer</strong>.com(37)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(38)last update: 11/7/2005 ,21:37

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

Saved successfully!

Ooh no, something went wrong!