//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // complex // operator-(const complex& lhs); #include #include template void test() { std::complex z(1.5, 2.5); assert(z.real() == 1.5); assert(z.imag() == 2.5); std::complex c = -z; assert(c.real() == -1.5); assert(c.imag() == -2.5); } int main() { test(); test(); test(); }