Subject: [Boost-bugs] [Boost C++ Libraries] #5298: Normal distribution: copy constructor doesn't yield intuitive correct behavior
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-13 14:03:26
#5298: Normal distribution: copy constructor doesn't yield intuitive correct
behavior
-------------------------------------------------+--------------------------
Reporter: Stefan Maagh <s.maagh@â¦> | Owner: steven_watanabe
Type: Bugs | Status: new
Milestone: To Be Determined | Component: random
Version: Boost 1.46.0 | Severity: Problem
Keywords: |
-------------------------------------------------+--------------------------
Purging the cache in the copy constructor of normal_distribution is not
fine. The compiler generated copy constructor yields the correct behavior.
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.
The attached example shows that using uniform_int instead
normal_distribution yields the expected behavior.
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.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5298> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC