sanjaykhan (4) [Avatar] Offline
In listing 6.7 ("Function that creates a memoized wrapper from a function pointer"), should the cache variable be static?
Ivan Cukic (54) [Avatar] Offline
No. The lifetime of the cache is tied to the lifetime of the lazy variable.

There are a few solutions that use a static cache, which I'll provide links to, but it is not something that this implementation needs.