Blitz logo

Blitz Bugs :

From: Björn Lindberg (d95-bli_at_[hidden])
Date: 2002-07-25 07:06:36


The problem is statements like

        Iter p0 = &S[0];

The S in question is an std::vector, while p0 is an
std::vector<...>::ierator. The iterator for eg an std::vector<int> is not
required to be of type int*. It often is, so the example above compiles in
most instances, but not on the STL library that comes with g++ 3.0.3. The
correct form is

        Iter p0 = S.begin();

Another example is

- Iter s_end = &S[N-1];
+ Iter s_end = S.begin()+N-1;

I have attached a small patch which corrects this error in six places in
the file random/mt.h.

Regards,

Björn Lindberg


_______________________________________________
Blitz-bugs mailing list
Blitz-bugs_at_[hidden]
http://www.oonumerics.org/mailman/listinfo.cgi/blitz-bugs