Boost C++ Libraries: Ticket #5298: Normal distribution: copy constructor doesn't yield intuitive correct behavior https://svn.boost.org/trac10/ticket/5298 <p> Purging the cache in the copy constructor of normal_distribution is not fine. The compiler generated copy constructor yields the correct behavior. </p> <p> In the attached example a generator (A) using normal_distribution is called once before a generator (B) is created as a copy of (A). The expected behavior is that calling (A) and (B) now produces identical sequences. But they don't. </p> <p> The attached example shows that using uniform_int instead normal_distribution yields the expected behavior. </p> <p> Applying the compiler generated copy constructor worked fine for me. Well, I expect that there was a reason to purge the cache although I can't see it. But for consistence and to provide intuitive correct behavior I suggest to apply the compiler generated copy constructor. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5298 Trac 1.4.3 Stefan Maagh <s.maagh@…> Sun, 13 Mar 2011 14:04:26 GMT attachment set https://svn.boost.org/trac10/ticket/5298 https://svn.boost.org/trac10/ticket/5298 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">testRandom.cpp</span> </li> </ul> Ticket Steven Watanabe Sun, 13 Mar 2011 18:32:03 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5298#comment:1 https://svn.boost.org/trac10/ticket/5298#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This has already been fixed in the trunk, since the current draft standard mandates the behavior that you want. The fix should be in 1.47. </p> Ticket