Subject: [Boost-bugs] [Boost C++ Libraries] #2424: unsigned int causes error in seed() without static_cast
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-10-19 04:23:09
#2424: unsigned int causes error in seed() without static_cast
--------------------------------------+-------------------------------------
Reporter: pjones13+boost_at_[hidden] | Owner: no-maintainer
Type: Bugs | Status: new
Milestone: Boost 1.37.0 | Component: random
Version: Boost 1.36.0 | Severity: Problem
Keywords: |
--------------------------------------+-------------------------------------
I posted this to the boost-user mailing list and it was recommended to
file a ticket here.
One must cast a variable as an unsigned int in the seed() function (even
though the variable is declared as an unsigned int). Here's a minimal code
segment that replicates the behavior:
{{{
boost::mt19937 rng;
unsigned int rseed = static_cast<unsigned int>(std::time(0));
rng.seed( rseed ); // This causes an error
rng.seed( static_cast<unsigned int>(rseed) ); // This works
}}}
-- Ticket URL: <http://svn.boost.org/trac/boost/ticket/2424> 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:49:59 UTC