Mixing complex numbers and ints
Peter Bienstman
Peter.Bienstman@rug.ac.be
Wed Dec 6 10:46:00 GMT 2000
Hi,
The following program
#include <complex>
int main()
{
std::complex<double> a(1,1);
a + 1;
}
produces
c.cpp: In function `int main()':
c.cpp:6: no match for `std::complex<double>& + int' operator
This worked in 2.95. Using doubles instead of ints does work.
Is this a true regression or just a correct implementation of stricter
promotion rules imposed by the standard?
Thanks,
Peter
>gcc -v
Reading specs from
/home/pbienst/gcc_Exp/bin/../lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --prefix=/home/pbienst/gcc_Exp/
--enable-languages=f77,c++
gcc version 2.97 20001128 (experimental)
-------------------------------------
Peter Bienstman
Department of Information Technology
INTEC/IMEC - Ghent University
St.-Pietersnieuwstraat 41
B-9000 Gent - Belgium
E-mail: Peter.Bienstman@rug.ac.be
Tel: +32 9 264 3445
Fax: +32 9 264 3593
-------------------------------------
More information about the Libstdc++
mailing list