Skip to content

Commit c903cd6

Browse files
bernhardmgruberdavebayer
authored andcommitted
Default transform_iterator's copy ctor (NVIDIA#3395)
Fixes: NVIDIA#2393
1 parent 0c2dba5 commit c903cd6

File tree

2 files changed

+2
-35
lines changed

2 files changed

+2
-35
lines changed

cub/test/catch2_large_array_sort_helper.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ template <typename KeyType>
6767
class key_sort_ref_key_transform
6868
{
6969
static constexpr double max_key = static_cast<double>(::cuda::std::numeric_limits<KeyType>::max());
70-
const double m_conversion;
70+
double m_conversion;
7171
std::size_t m_num_items;
7272
bool m_is_descending;
7373

thrust/thrust/iterator/transform_iterator.h

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ class transform_iterator
198198
/*! \endcond
199199
*/
200200

201-
public:
202201
/*! Null constructor does nothing.
203202
*/
204203
transform_iterator() = default;
@@ -239,20 +238,7 @@ class transform_iterator
239238
, m_f(other.functor())
240239
{}
241240

242-
/*! Copy assignment operator copies from another \p transform_iterator.
243-
* \p other The other \p transform_iterator to copy
244-
* \return <tt>*this</tt>
245-
*
246-
* \note If the type of this \p transform_iterator's functor is not copy assignable
247-
* (for example, if it is a lambda) it is not an error to call this function.
248-
* In this case, however, the functor will not be modified.
249-
*
250-
* In any case, this \p transform_iterator's underlying iterator will be copy assigned.
251-
*/
252-
_CCCL_HOST_DEVICE transform_iterator& operator=(const transform_iterator& other)
253-
{
254-
return do_assign(other, ::cuda::std::is_copy_assignable<AdaptableUnaryFunction>());
255-
}
241+
transform_iterator& operator=(const transform_iterator&) = default;
256242

257243
/*! This method returns a copy of this \p transform_iterator's \c AdaptableUnaryFunction.
258244
* \return A copy of this \p transform_iterator's \c AdaptableUnaryFunction.
@@ -266,25 +252,6 @@ class transform_iterator
266252
*/
267253

268254
private:
269-
_CCCL_HOST_DEVICE transform_iterator& do_assign(const transform_iterator& other, thrust::detail::true_type)
270-
{
271-
super_t::operator=(other);
272-
273-
// do assign to m_f
274-
m_f = other.functor();
275-
276-
return *this;
277-
}
278-
279-
_CCCL_HOST_DEVICE transform_iterator& do_assign(const transform_iterator& other, thrust::detail::false_type)
280-
{
281-
super_t::operator=(other);
282-
283-
// don't assign to m_f
284-
285-
return *this;
286-
}
287-
288255
// MSVC 2013 and 2015 incorrectly warning about returning a reference to
289256
// a local/temporary here.
290257
// See goo.gl/LELTNp

0 commit comments

Comments
 (0)