1
1
/*
2
- * Copyright 2008-2021 NVIDIA Corporation
2
+ * Copyright 2008-2024 NVIDIA Corporation
3
3
* Copyright 2013 Filipe RNC Maia
4
4
*
5
5
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,97 +26,44 @@ THRUST_NAMESPACE_BEGIN
26
26
27
27
/* --- Constructors --- */
28
28
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
-
38
29
template <typename T>
39
30
_CCCL_HOST_DEVICE complex<T>::complex(const T& re)
40
- #if THRUST_CPP_DIALECT >= 2011
41
31
// Initialize the storage in the member initializer list using C++ unicorn
42
32
// initialization. This allows `complex<T const>` to work.
43
33
: data{re, T ()}
44
34
{}
45
- #else
46
- {
47
- real (re);
48
- imag (T ());
49
- }
50
- #endif
51
35
52
36
template <typename T>
53
37
_CCCL_HOST_DEVICE complex<T>::complex(const T& re, const T& im)
54
- #if THRUST_CPP_DIALECT >= 2011
55
38
// Initialize the storage in the member initializer list using C++ unicorn
56
39
// initialization. This allows `complex<T const>` to work.
57
40
: data{re, im}
58
41
{}
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
74
42
75
43
template <typename T>
76
44
template <typename U>
77
45
_CCCL_HOST_DEVICE complex<T>::complex(const complex<U>& z)
78
- #if THRUST_CPP_DIALECT >= 2011
79
46
// Initialize the storage in the member initializer list using C++ unicorn
80
47
// initialization. This allows `complex<T const>` to work.
81
48
// We do a functional-style cast here to suppress conversion warnings.
82
49
: data{T (z.real ()), T (z.imag ())}
83
50
{}
84
- #else
85
- {
86
- real (T (z.real ()));
87
- imag (T (z.imag ()));
88
- }
89
- #endif
90
51
91
52
template <typename T>
92
53
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>::complex(const std::complex<T>& z)
93
- #if THRUST_CPP_DIALECT >= 2011
94
54
// Initialize the storage in the member initializer list using C++ unicorn
95
55
// initialization. This allows `complex<T const>` to work.
96
56
: data{THRUST_STD_COMPLEX_REAL (z), THRUST_STD_COMPLEX_IMAG (z)}
97
57
{}
98
- #else
99
- {
100
- real (THRUST_STD_COMPLEX_REAL (z));
101
- imag (THRUST_STD_COMPLEX_IMAG (z));
102
- }
103
- #endif
104
58
105
59
template <typename T>
106
60
template <typename U>
107
61
_CCCL_HOST THRUST_STD_COMPLEX_DEVICE complex<T>::complex(const std::complex<U>& z)
108
- #if THRUST_CPP_DIALECT >= 2011
109
62
// Initialize the storage in the member initializer list using C++ unicorn
110
63
// initialization. This allows `complex<T const>` to work.
111
64
// We do a functional-style cast here to suppress conversion warnings.
112
65
: data{T (THRUST_STD_COMPLEX_REAL (z)), T (THRUST_STD_COMPLEX_IMAG (z))}
113
66
{}
114
- #else
115
- {
116
- real (T (THRUST_STD_COMPLEX_REAL (z)));
117
- imag (T (THRUST_STD_COMPLEX_IMAG (z)));
118
- }
119
- #endif
120
67
121
68
/* --- Assignment Operators --- */
122
69
@@ -128,16 +75,6 @@ _CCCL_HOST_DEVICE complex<T>& complex<T>::operator=(const T& re)
128
75
return *this ;
129
76
}
130
77
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
-
141
78
template <typename T>
142
79
template <typename U>
143
80
_CCCL_HOST_DEVICE complex<T>& complex<T>::operator =(const complex<U>& z)
0 commit comments