g++4.3.0 is wrongly eliding the copy constructor and the assignment of a struct. Look at the following code: #include <iostream> #include <complex> struct Complex { std::complex<double> value; }; const Complex one = { 1 }; int main() { Complex z = one, w; w = one; std::cout << "one = " << one.value << std::endl; std::cout << "z = " << z.value << std::endl; std::cout << "w = " << w.value << std::endl; } It prints: one = (1,0) z = (0,0) w = (0,0) When the value is of type double instead of complex<double> the problem doesn't occur. Also, this doesn't happen using the compiler switch -fno-elide-constructors .
Works for me with current compilers built out any active release branch.