1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <complex> 10 11 // template<class T> 12 // complex<T> 13 // operator/(const complex<T>& lhs, const T& rhs); 14 15 #include <complex> 16 #include <cassert> 17 18 template <class T> 19 void 20 test(const std::complex<T>& lhs, const T& rhs, std::complex<T> x) 21 { 22 assert(lhs / rhs == x); 23 } 24 25 template <class T> 26 void 27 test() 28 { 29 std::complex<T> lhs(-4.0, 7.5); 30 T rhs(2); 31 std::complex<T> x(-2, 3.75); 32 test(lhs, rhs, x); 33 } 34 35 int main(int, char**) 36 { 37 test<float>(); 38 test<double>(); 39 test<long double>(); 40 41 return 0; 42 } 43