<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Template metaprogramming - Page 11 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Template_metaprogramming&amp;p=10">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Template_metaprogramming&amp;p=12">3.Next</a>
</p>
<p>overhead and <a href="page.php?w=memory_footprint">memory footprint</a>. It is, however, a relatively minor optimization.</p>

<p>As another, more significant, example of compile-time <a href="page.php?w=loop_unrolling">loop unrolling</a>, template metaprogramming can be used to create length-n vector classes (where n is known at compile time). The benefit over a more traditional length-n vector is that the loops can be unrolled, resulting in very optimized code. As an example, consider the addition operator. A length-n vector addition might</p><p>
<a accesskey="1" href="page.php?w=Template_metaprogramming&amp;p=10">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Template_metaprogramming&amp;p=12">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
