Skip to content

Commit 2ff83a2

Browse files
authored
Clean up complex.inl (#1655)
1 parent 97e699f commit 2ff83a2

File tree

1 file changed

+1
-64
lines changed

1 file changed

+1
-64
lines changed

thrust/thrust/detail/complex/complex.inl

+1-64
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2008-2021 NVIDIA Corporation
2+
* Copyright 2008-2024 NVIDIA Corporation
33
* Copyright 2013 Filipe RNC Maia
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,97 +26,44 @@ THRUST_NAMESPACE_BEGIN
2626

2727
/* --- Constructors --- */
2828

29-
#if THRUST_CPP_DIALECT < 2011
30-
template <typename T>
31-
_CCCL_HOST_DEVICE complex<T>::complex()
32-
{
33-
real(T());
34-
imag(T());
35-
}
36-
#endif
37-
3829
template <typename T>
3930
_CCCL_HOST_DEVICE complex<T>::complex(const T& re)
40-
#if THRUST_CPP_DIALECT >= 2011
4131
// Initialize the storage in the member initializer list using C++ unicorn
4232
// initialization. This allows `complex<T const>` to work.
4333
: data{re, T()}
4434
{}
45-
#else
46-
{
47-
real(re);
48-
imag(T());
49-
}
50-
#endif
5135

5236
template <typename T>
5337
_CCCL_HOST_DEVICE complex<T>::complex(const T& re, const T& im)
54-
#if THRUST_CPP_DIALECT >= 2011
5538
// Initialize the storage in the member initializer list using C++ unicorn
5639
// initialization. This allows `complex<T const>` to work.
5740
: data{re, im}
5841
{}
59-
#else
60-
{
61-
real(re);
62-
imag(im);
63-
}
64-
#endif
65-
66-
#if THRUST_CPP_DIALECT < 2011
67-
template <typename T>
68-
_CCCL_HOST_DEVICE complex<T>::complex(const complex<T>& z)
69-
{
70-
real(z.real());
71-
imag(z.imag());
72-
}
73-
#endif
7442

7543
template <typename T>
7644
template <typename U>
7745
_CCCL_HOST_DEVICE complex<T>::complex(const complex<U>& z)
78-
#if THRUST_CPP_DIALECT >= 2011
7946
// Initialize the storage in the member initializer list using C++ unicorn
8047
// initialization. This allows `complex<T const>` to work.
8148
// We do a functional-style cast here to suppress conversion warnings.
8249
: data{T(z.real()), T(z.imag())}
8350
{}
84-
#else
85-
{
86-
real(T(z.real()));
87-
imag(T(z.imag()));
88-
}
89-
#endif
9051

9152
template <typename T>
9253
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>::complex(const std::complex<T>& z)
93-
#if THRUST_CPP_DIALECT >= 2011
9454
// Initialize the storage in the member initializer list using C++ unicorn
9555
// initialization. This allows `complex<T const>` to work.
9656
: data{THRUST_STD_COMPLEX_REAL(z), THRUST_STD_COMPLEX_IMAG(z)}
9757
{}
98-
#else
99-
{
100-
real(THRUST_STD_COMPLEX_REAL(z));
101-
imag(THRUST_STD_COMPLEX_IMAG(z));
102-
}
103-
#endif
10458

10559
template <typename T>
10660
template <typename U>
10761
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>::complex(const std::complex<U>& z)
108-
#if THRUST_CPP_DIALECT >= 2011
10962
// Initialize the storage in the member initializer list using C++ unicorn
11063
// initialization. This allows `complex<T const>` to work.
11164
// We do a functional-style cast here to suppress conversion warnings.
11265
: data{T(THRUST_STD_COMPLEX_REAL(z)), T(THRUST_STD_COMPLEX_IMAG(z))}
11366
{}
114-
#else
115-
{
116-
real(T(THRUST_STD_COMPLEX_REAL(z)));
117-
imag(T(THRUST_STD_COMPLEX_IMAG(z)));
118-
}
119-
#endif
12067

12168
/* --- Assignment Operators --- */
12269

@@ -128,16 +75,6 @@ _CCCL_HOST_DEVICE complex<T>& complex<T>::operator=(const T& re)
12875
return *this;
12976
}
13077

131-
#if THRUST_CPP_DIALECT < 2011
132-
template <typename T>
133-
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator=(const complex<T>& z)
134-
{
135-
real(z.real());
136-
imag(z.imag());
137-
return *this;
138-
}
139-
#endif
140-
14178
template <typename T>
14279
template <typename U>
14380
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator=(const complex<U>& z)

0 commit comments

Comments
 (0)