Skip to content

Commit fcbfcd3

Browse files
committed
fixup! modernize-use-equals-default
1 parent 54338e2 commit fcbfcd3

4 files changed

Lines changed: 8 additions & 31 deletions

File tree

thrust/examples/uninitialized_vector.cu

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ struct uninitialized_allocator : thrust::device_allocator<T>
2121
// marked __host__ __device__, but the current Thrust device_allocator
2222
// can only be constructed and destroyed on the host; therefore, we
2323
// define these as host only
24-
__host__ uninitialized_allocator();
24+
__host__ uninitialized_allocator() {} // NOLINT(modernize-use-equals-default)
2525
__host__ uninitialized_allocator(const uninitialized_allocator& other)
2626
: thrust::device_allocator<T>(other)
2727
{}
28-
__host__ ~uninitialized_allocator();
28+
__host__ ~uninitialized_allocator() {} // NOLINT(modernize-use-equals-default)
2929

3030
uninitialized_allocator& operator=(const uninitialized_allocator&) = default;
3131

@@ -47,11 +47,6 @@ struct uninitialized_allocator : thrust::device_allocator<T>
4747
}
4848
};
4949

50-
template <typename T>
51-
uninitialized_allocator<T>::uninitialized_allocator() = default;
52-
template <typename T>
53-
uninitialized_allocator<T>::~uninitialized_allocator() = default;
54-
5550
// to make a device_vector which does not initialize its elements,
5651
// use uninitialized_allocator as the 2nd template parameter
5752
using uninitialized_vector = thrust::device_vector<float, uninitialized_allocator<float>>;

thrust/testing/allocator.cu

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ struct my_allocator_with_custom_destroy
8080

8181
static bool g_state;
8282

83-
_CCCL_HOST my_allocator_with_custom_destroy();
83+
_CCCL_HOST my_allocator_with_custom_destroy() {} // NOLINT(modernize-use-equals-default)
8484

8585
_CCCL_HOST my_allocator_with_custom_destroy(const my_allocator_with_custom_destroy& other)
8686
: use_me_to_alloc(other.use_me_to_alloc)
8787
{}
8888

89-
_CCCL_HOST ~my_allocator_with_custom_destroy();
89+
_CCCL_HOST ~my_allocator_with_custom_destroy() {} // NOLINT(modernize-use-equals-default)
9090

9191
_CCCL_HOST_DEVICE void destroy(T*) noexcept
9292
{
@@ -121,12 +121,6 @@ struct my_allocator_with_custom_destroy
121121
std::allocator<T> use_me_to_alloc;
122122
};
123123

124-
template <typename T>
125-
my_allocator_with_custom_destroy<T>::my_allocator_with_custom_destroy() = default;
126-
127-
template <typename T>
128-
my_allocator_with_custom_destroy<T>::~my_allocator_with_custom_destroy() = default;
129-
130124
template <typename T>
131125
bool my_allocator_with_custom_destroy<T>::g_state = false;
132126

@@ -155,13 +149,13 @@ struct my_minimal_allocator
155149
using reference = T&;
156150
using const_reference = const T&;
157151

158-
_CCCL_HOST my_minimal_allocator();
152+
_CCCL_HOST my_minimal_allocator() {} // NOLINT(modernize-use-equals-default)
159153

160154
_CCCL_HOST my_minimal_allocator(const my_minimal_allocator& other)
161155
: use_me_to_alloc(other.use_me_to_alloc)
162156
{}
163157

164-
_CCCL_HOST ~my_minimal_allocator();
158+
_CCCL_HOST ~my_minimal_allocator() {} // NOLINT(modernize-use-equals-default)
165159

166160
value_type* allocate(std::ptrdiff_t n)
167161
{
@@ -176,12 +170,6 @@ struct my_minimal_allocator
176170
std::allocator<T> use_me_to_alloc;
177171
};
178172

179-
template <typename T>
180-
my_minimal_allocator<T>::my_minimal_allocator() = default;
181-
182-
template <typename T>
183-
my_minimal_allocator<T>::~my_minimal_allocator() = default;
184-
185173
template <typename T>
186174
void TestAllocatorMinimal(size_t n)
187175
{

thrust/thrust/device_vector.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class device_vector : public detail::vector_base<T, Alloc>
7777
/*! The destructor erases the elements.
7878
*/
7979
_CCCL_EXEC_CHECK_DISABLE
80-
_CCCL_HOST ~device_vector();
80+
_CCCL_HOST ~device_vector() {} // NOLINT(modernize-use-equals-default)
8181

8282
/*! This constructor creates a \p device_vector with the given
8383
* size.
@@ -644,9 +644,6 @@ class device_vector : public detail::vector_base<T, Alloc>
644644
#endif // end doxygen-only members
645645
};
646646

647-
template <typename T, typename Alloc>
648-
device_vector<T, Alloc>::~device_vector() = default;
649-
650647
/*! \} // containres
651648
*/
652649

thrust/thrust/host_vector.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class host_vector : public detail::vector_base<T, Alloc>
9292
* \endverbatim
9393
*/
9494
_CCCL_EXEC_CHECK_DISABLE
95-
_CCCL_HOST ~host_vector();
95+
_CCCL_HOST ~host_vector() {} // NOLINT(modernize-use-equals-default)
9696

9797
/*! This constructor creates a \p host_vector with the given
9898
* size.
@@ -700,9 +700,6 @@ class host_vector : public detail::vector_base<T, Alloc>
700700
}
701701
};
702702

703-
template <typename T, typename Alloc>
704-
host_vector<T, Alloc>::~host_vector() = default;
705-
706703
/*! \}
707704
*/
708705

0 commit comments

Comments
 (0)