//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // complex& operator=(const complex&); // template complex& operator= (const complex&); #include #include template void test() { std::complex c; assert(c.real() == 0); assert(c.imag() == 0); std::complex c2(1.5, 2.5); c = c2; assert(c.real() == 1.5); assert(c.imag() == 2.5); std::complex c3(3.5, -4.5); c = c3; assert(c.real() == 3.5); assert(c.imag() == -4.5); } int main() { test(); test(); test(); test(); test(); test(); test(); test(); test(); }