--- random/mt.h.orig Wed Jul 24 23:11:38 2002 +++ random/mt.h Wed Jul 24 23:16:01 2002 @@ -95,7 +95,7 @@ void initialize() { S.resize(N); - I = &S[N]; + I = S.begin() + N; } public: @@ -132,7 +132,7 @@ enum { Knuth_A = 69069 }; twist_int x = seed & 0xFFFFFFFF; - Iter s = &S[0]; + Iter s = S.begin(); twist_int mask = (seed == reference_seed) ? 0 : 0xFFFFFFFF; for (int j = 0; j < N; ++j) { // adding j here avoids the risk of all zeros @@ -150,18 +150,18 @@ // before the constructor. See the note above about static // initialization. - Iter p0 = &S[0]; + Iter p0 = S.begin(); Iter pM = p0 + PF; BitMixer twist; twist (S[0]); // prime the pump - for (Iter pf_end = &S[N-PF]; p0 != pf_end; ++p0, ++pM) + for (Iter pf_end = S.begin()+N-PF; p0 != pf_end; ++p0, ++pM) *p0 = *pM ^ twist (p0[1]); pM = S.begin(); - for (Iter s_end = &S[N-1]; p0 != s_end; ++p0, ++pM) + for (Iter s_end = S.begin()+N-1; p0 != s_end; ++p0, ++pM) *p0 = *pM ^ twist (p0[1]); *p0 = *pM ^ twist (S[0]); - I = &S[0]; + I = S.begin(); } inline twist_int random (void)