On Thu, Oct 16, 2008 at 7:39 PM, Steven Watanabe <watanabesj@gmail.com> wrote:
The constructor takes a baseGenerator by value, which is then destroyed when
 the constructor returns.

Believe it or not, I thought about that when I wrote it, and was amazed that it worked.  I promptly forgot about it, and then was severely confused later when I compiled in debug mode, which for me includes turning off optimizations.  So, is it just pure luck that it works fine in so many cases?  I find it hard to believe that the optimizations would have eliminated enough stack activity so that it worked reliably.