Subject: Re: [boost] [UUID] version v12
From: Johannes Brunen (JBrunen_at_[hidden])
Date: 2008-10-13 07:12:02
after some investigations, I think that I have found the origin of the
In seed_rng.hpp the following code is used:
template <typename UniformRandomNumberGenerator>
inline void seed(UniformRandomNumberGenerator& rng)
Problematic is the construction of the end iterator. Looking into the code
(boost/generator_iterator.hpp) shows, that the default constructor of
generator_iterator does not initialize its member variables.
Howerver, the mersenne_twister seed code does compare the two given
iterators as shown below (boost/random/).
void seed(It& first, It last)
for(j = 0; j < n && first != last; ++j, ++first)
x[j] = *first;
i = n;
if(first == last && j < n)
As the end iterator is not initialized the way is open for all throwing the
Locally, I did solve the problem by patching the default constructor of
If this is a valid solution of the problem, it would be fine if anyone
applies the correction to the boost code.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk