Boost logo

Boost Users :

From: Johan Råde (rade_at_[hidden])
Date: 2005-07-20 13:06:12


I just discovered a bug when using boost::array with MSVC 7.1.
I have project with about 100 cpp files and 20.000 lines of code.
It uses about a dozen different boost libraries.
When I compile with the compiler option /GL (whole program optimization)
then I get an internal compiler error.
It is certainly a compiler bug.
The option /GL is a somewhat experimental feature.

The boost::array source code contains a templatized assignment operator
with type conversion.
If I add a regular assignment operator, then the code compiles.
In fact, I get a clean /W4 build :-)

I have tried to reproduce the bug in a smaller example, but with no
Smaller projects compile just fine.

I propose that the following lines be added to array.hpp:

// assignment without type conversion (sometimes needed with MSVC 7.1
with option /GL)
array<T,N>& operator= (const array<T,N>& rhs) {
   std::copy(rhs.begin(),rhs.end(), begin());
   return *this;

--Johan Råde

Department of Mathematics
Lund University
Lund, Sweden

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at