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.

5The RecursionRecursive definition of Root::root:template struct Root {static const size_t root =Root::root;static const size_t mean = (Low+High)/2;static const bool down = ((mean*mean)>=Size);};Root => Rootmean = (1+10)/2 = 5down = (5*5>=10) = true© Copyright 1995-2000 by <strong>Angelika</strong> <strong>Langer</strong>. All Rights Reserved.http://www.<strong>Angelika</strong><strong>Langer</strong>.com(9)last update: 11/7/2005 ,21:37End of the RecursionRoot => Rootmean = (1+5)/2 = 3down = (3*3>=10) = falseRoot => Rootmean = (4+5)/2 = 4down = (4*4>=10) = trueEnd of recursion:template struct Root{ static const size_t root = Mid; };© Copyright 1995-2000 by <strong>Angelika</strong> <strong>Langer</strong>. All Rights Reserved.http://www.<strong>Angelika</strong><strong>Langer</strong>.com(10)last update: 11/7/2005 ,21:37

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

Saved successfully!

Ooh no, something went wrong!