1//===----------------------------------------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is dual licensed under the MIT and the University of Illinois Open 6// Source Licenses. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10// <complex> 11 12// template<class T> 13// complex<T> 14// operator*(const T& lhs, const complex<T>& rhs); 15 16#include <complex> 17#include <cassert> 18 19template <class T> 20void 21test(const T& lhs, const std::complex<T>& rhs, std::complex<T> x) 22{ 23 assert(lhs * rhs == x); 24} 25 26template <class T> 27void 28test() 29{ 30 T lhs(1.5); 31 std::complex<T> rhs(1.5, 2.5); 32 std::complex<T> x(2.25, 3.75); 33 test(lhs, rhs, x); 34} 35 36int main() 37{ 38 test<float>(); 39 test<double>(); 40 test<long double>(); 41} 42