">Key-value flyweights</a>
can be used to implement memoization for a numerical function <i>f</i>
by modeling a memoized invocation of the function as a value of
type <code>flyweight&lt;key_value&lt;int,compute_f&gt; &gt;</code>, where
<code>compute_f</code> is a type that does the computation of
<i>f</i>(<i>n</i>) at its <code>compute_f::compute_f(int)</code> constructor.
For instance, the <a href="http://mathworld.wolfram.com/FibonacciNumber.html">Fibonacci
numbers</a> can be computed with memoization lik