|
Boost Users : |
From: Johan Råde (rade_at_[hidden])
Date: 2005-07-20 13:06:12
Hi,
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
success.
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 hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net