diff --git a/thrust/thrust/detail/complex/complex.inl b/thrust/thrust/detail/complex/complex.inl index 6532f32fc6..3f4c126931 100644 --- a/thrust/thrust/detail/complex/complex.inl +++ b/thrust/thrust/detail/complex/complex.inl @@ -1,5 +1,5 @@ /* - * Copyright 2008-2021 NVIDIA Corporation + * Copyright 2008-2024 NVIDIA Corporation * Copyright 2013 Filipe RNC Maia * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,97 +26,44 @@ THRUST_NAMESPACE_BEGIN /* --- Constructors --- */ -#if THRUST_CPP_DIALECT < 2011 -template -_CCCL_HOST_DEVICE complex::complex() -{ - real(T()); - imag(T()); -} -#endif - template _CCCL_HOST_DEVICE complex::complex(const T& re) -#if THRUST_CPP_DIALECT >= 2011 // Initialize the storage in the member initializer list using C++ unicorn // initialization. This allows `complex` to work. : data{re, T()} {} -#else -{ - real(re); - imag(T()); -} -#endif template _CCCL_HOST_DEVICE complex::complex(const T& re, const T& im) -#if THRUST_CPP_DIALECT >= 2011 // Initialize the storage in the member initializer list using C++ unicorn // initialization. This allows `complex` to work. : data{re, im} {} -#else -{ - real(re); - imag(im); -} -#endif - -#if THRUST_CPP_DIALECT < 2011 -template -_CCCL_HOST_DEVICE complex::complex(const complex& z) -{ - real(z.real()); - imag(z.imag()); -} -#endif template template _CCCL_HOST_DEVICE complex::complex(const complex& z) -#if THRUST_CPP_DIALECT >= 2011 // Initialize the storage in the member initializer list using C++ unicorn // initialization. This allows `complex` to work. // We do a functional-style cast here to suppress conversion warnings. : data{T(z.real()), T(z.imag())} {} -#else -{ - real(T(z.real())); - imag(T(z.imag())); -} -#endif template _CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex::complex(const std::complex& z) -#if THRUST_CPP_DIALECT >= 2011 // Initialize the storage in the member initializer list using C++ unicorn // initialization. This allows `complex` to work. : data{THRUST_STD_COMPLEX_REAL(z), THRUST_STD_COMPLEX_IMAG(z)} {} -#else -{ - real(THRUST_STD_COMPLEX_REAL(z)); - imag(THRUST_STD_COMPLEX_IMAG(z)); -} -#endif template template _CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex::complex(const std::complex& z) -#if THRUST_CPP_DIALECT >= 2011 // Initialize the storage in the member initializer list using C++ unicorn // initialization. This allows `complex` to work. // We do a functional-style cast here to suppress conversion warnings. : data{T(THRUST_STD_COMPLEX_REAL(z)), T(THRUST_STD_COMPLEX_IMAG(z))} {} -#else -{ - real(T(THRUST_STD_COMPLEX_REAL(z))); - imag(T(THRUST_STD_COMPLEX_IMAG(z))); -} -#endif /* --- Assignment Operators --- */ @@ -128,16 +75,6 @@ _CCCL_HOST_DEVICE complex& complex::operator=(const T& re) return *this; } -#if THRUST_CPP_DIALECT < 2011 -template -_CCCL_HOST_DEVICE complex& complex::operator=(const complex& z) -{ - real(z.real()); - imag(z.imag()); - return *this; -} -#endif - template template _CCCL_HOST_DEVICE complex& complex::operator=(const complex& z)