Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit 37a638e

Browse files
committed
Address review comments
1 parent 12112f5 commit 37a638e

File tree

6 files changed

+5
-21
lines changed

6 files changed

+5
-21
lines changed

testing/vector.cu

-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ void TestVectorBool(void)
4040
}
4141
DECLARE_UNITTEST(TestVectorBool);
4242

43-
#if THRUST_CPP_DIALECT >= 2011
4443
template <class Vector>
4544
void TestVectorInitializerList(void)
4645
{
@@ -65,7 +64,6 @@ void TestVectorInitializerList(void)
6564
ASSERT_EQUAL(v2[2], 3);
6665
}
6766
DECLARE_VECTOR_UNITTEST(TestVectorInitializerList);
68-
#endif
6967

7068
template <class Vector>
7169
void TestVectorFrontBack(void)

thrust/detail/vector_base.h

-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
#include <thrust/detail/config.h>
3030
#include <thrust/detail/contiguous_storage.h>
3131

32-
#if THRUST_CPP_DIALECT >= 2011
3332
#include <initializer_list>
34-
#endif
3533
#include <vector>
3634

3735
THRUST_NAMESPACE_BEGIN
@@ -127,7 +125,6 @@ template<typename T, typename Alloc>
127125
*/
128126
vector_base &operator=(const vector_base &v);
129127

130-
#if THRUST_CPP_DIALECT >= 2011
131128
/*! Move assign operator moves from another vector_base.
132129
* \param v The vector_base to move.
133130
*/
@@ -148,7 +145,6 @@ template<typename T, typename Alloc>
148145
* \param il The initializer_list.
149146
*/
150147
vector_base &operator=(std::initializer_list<T> il);
151-
#endif
152148

153149
/*! Copy constructor copies from an exemplar vector_base with different
154150
* type.

thrust/detail/vector_base.inl

-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ template<typename T, typename Alloc>
195195
return *this;
196196
} // end vector_base::operator=()
197197

198-
#if THRUST_CPP_DIALECT >= 2011
199198
template<typename T, typename Alloc>
200199
vector_base<T,Alloc>
201200
::vector_base(std::initializer_list<T> il)
@@ -223,7 +222,6 @@ template<typename T, typename Alloc>
223222

224223
return *this;
225224
} // end vector_base::operator=()
226-
#endif
227225

228226
template<typename T, typename Alloc>
229227
template<typename IteratorOrIntegralType>

thrust/device_vector.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
#include <thrust/detail/vector_base.h>
2727
#include <thrust/device_allocator.h>
2828

29-
#if THRUST_CPP_DIALECT >= 2011
3029
#include <initializer_list>
31-
#endif
3230
#include <vector>
3331
#include <utility>
3432

@@ -200,26 +198,24 @@ template<typename T, typename Alloc = thrust::device_allocator<T> >
200198
device_vector &operator=(const detail::vector_base<OtherT,OtherAlloc> &v)
201199
{ Parent::operator=(v); return *this; }
202200

203-
#if THRUST_CPP_DIALECT >= 2011
204201
/*! This constructor builds a \p device_vector from an intializer_list.
205202
* \param il The intializer_list.
206203
*/
207204
device_vector(std::initializer_list<T> il)
208-
:Parent(il.begin(), il.end()) {}
205+
:Parent(il) {}
209206

210207
/*! This constructor builds a \p device_vector from an intializer_list.
211208
* \param il The intializer_list.
212209
* \param alloc The allocator to use by this device_vector.
213210
*/
214211
device_vector(std::initializer_list<T> il, const Alloc &alloc)
215-
:Parent(il.begin(), il.end(), alloc) {}
212+
:Parent(il, alloc) {}
216213

217214
/*! Assign an \p intializer_list with a matching element type
218215
* \param il The intializer_list.
219216
*/
220217
device_vector &operator=(std::initializer_list<T> il)
221218
{ Parent::operator=(il); return *this; }
222-
#endif
223219

224220
/*! This constructor builds a \p device_vector from a range.
225221
* \param first The beginning of the range.

thrust/host_vector.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
#include <thrust/detail/memory_wrapper.h>
2727
#include <thrust/detail/vector_base.h>
2828

29-
#if THRUST_CPP_DIALECT >= 2011
3029
#include <initializer_list>
31-
#endif
3230
#include <vector>
3331
#include <utility>
3432

@@ -221,26 +219,24 @@ template<typename T, typename Alloc = std::allocator<T> >
221219
host_vector &operator=(const detail::vector_base<OtherT,OtherAlloc> &v)
222220
{ Parent::operator=(v); return *this; }
223221

224-
#if THRUST_CPP_DIALECT >= 2011
225222
/*! This constructor builds a \p host_vector from an intializer_list.
226223
* \param il The intializer_list.
227224
*/
228225
host_vector(std::initializer_list<T> il)
229-
:Parent(il.begin(), il.end()) {}
226+
:Parent(il) {}
230227

231228
/*! This constructor builds a \p host_vector from an intializer_list.
232229
* \param il The intializer_list.
233230
* \param alloc The allocator to use by this host_vector.
234231
*/
235232
host_vector(std::initializer_list<T> il, const Alloc &alloc)
236-
:Parent(il.begin(), il.end(), alloc) {}
233+
:Parent(il, alloc) {}
237234

238235
/*! Assign an \p intializer_list with a matching element type
239236
* \param il The intializer_list.
240237
*/
241238
host_vector &operator=(std::initializer_list<T> il)
242239
{ Parent::operator=(il); return *this; }
243-
#endif
244240

245241
/*! This constructor builds a \p host_vector from a range.
246242
* \param first The beginning of the range.

thrust/system/cpp/detail/vector.inl

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ template<typename T, typename Allocator>
9797
super_t::operator=(std::move(x));
9898
return *this;
9999
}
100+
#endif
100101

101102
template<typename T, typename Allocator>
102103
vector<T,Allocator>
@@ -118,7 +119,6 @@ template<typename T, typename Allocator>
118119
super_t::operator=(il);
119120
return *this;
120121
}
121-
#endif
122122

123123
template<typename T, typename Allocator>
124124
template<typename OtherT, typename OtherAllocator>

0 commit comments

Comments
 (0)