Boost logo

Boost :

From: Gennadiy E. Rozental (rogeeff_at_[hidden])
Date: 2001-09-07 14:36:34


Hi,

Forte C++ seems to have a problem resolving seed function call in
mersenne_twister.hpp:line 64. It keep trying to use template function
while it should use nontemplatete one.
 I have played a little bit more with it and found another fix:

Index: mersenne_twister.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/random/mersenne_twister.hpp,v
retrieving revision 1.4
diff -d -r1.4 mersenne_twister.hpp
64c64
< explicit mersenne_twister(DataType value) { seed(value); }

---
>   explicit mersenne_twister(DataType const value) { seed(value); }
69c69
<   void seed(DataType value) {
---
>   void seed(DataType const& value) {
Do you think this is better?
Gennadiy.
P.S. At least we could put this under ifdef guard
--- In boost_at_y..., Darin Adler <darin_at_b...> wrote:
> on 9/7/01 8:16 AM, Gennadiy E. Rozental at rogeeff_at_m... wrote:
> 
> > Index: mersenne_twister.hpp
> > 
===================================================================
> > RCS file: /cvsroot/boost/boost/boost/random/mersenne_twister.hpp,v
> > retrieving revision 1.4
> > diff -r1.4 mersenne_twister.hpp
> > 64c64
> > <   explicit mersenne_twister(DataType value) { seed(value); }
> > ---
> >>   explicit mersenne_twister(DataType value) { seed_value
(value); }
> > 68,69c68,69
> > <   void seed() { seed(DataType(4357)); }
> > <   void seed(DataType value) {
> > ---
> >>   void seed() { seed_value(DataType(4357)); }
> >>   void seed_value(DataType value) {
> 
> In the boost libraries, we don't normally change designs to 
accommodate
> compilers that have problems with C++ features (like the problem 
with
> overloading here). So we probably want to approach fixing this a 
different
> way.
> 
>     -- Darin

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk