Skip to content

Commit fe126bb

Browse files
Deprecate thrust::null_type
1 parent 18b8e43 commit fe126bb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

thrust/testing/tuple.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ DECLARE_UNITTEST(TestTupleCTAD);
529529
#endif // _CCCL_STD_VER >= 2017
530530

531531
// Ensure that we are backwards compatible with the old thrust::tuple implementation
532+
_CCCL_SUPPRESS_DEPRECATED_PUSH
532533
static_assert(
533534
thrust::tuple_size<thrust::tuple<thrust::null_type,
534535
thrust::null_type,
@@ -625,3 +626,4 @@ static_assert(
625626
static_assert(
626627
thrust::tuple_size<thrust::tuple<int, int, int, int, int, int, int, int, int, thrust::null_type>>::value == 9, "");
627628
static_assert(thrust::tuple_size<thrust::tuple<int, int, int, int, int, int, int, int, int, int>>::value == 10, "");
629+
_CCCL_SUPPRESS_DEPRECATED_POP

thrust/thrust/tuple.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@
4444
THRUST_NAMESPACE_BEGIN
4545

4646
// define null_type for backwards compatibility
47-
struct null_type
47+
struct CCCL_DEPRECATED_BECAUSE("Please remove null_type from parameters to tuple<...>") null_type
4848
{};
4949

50+
_CCCL_SUPPRESS_DEPRECATED_PUSH
51+
5052
_CCCL_HOST_DEVICE inline bool operator==(const null_type&, const null_type&)
5153
{
5254
return true;
@@ -77,6 +79,8 @@ _CCCL_HOST_DEVICE inline bool operator>(const null_type&, const null_type&)
7779
return false;
7880
}
7981

82+
_CCCL_SUPPRESS_DEPRECATED_POP
83+
8084
/*! \addtogroup utility
8185
* \{
8286
*/
@@ -176,6 +180,7 @@ using _CUDA_VSTD::tie;
176180
THRUST_NAMESPACE_END
177181

178182
_LIBCUDACXX_BEGIN_NAMESPACE_STD
183+
_CCCL_SUPPRESS_DEPRECATED_PUSH
179184

180185
template <>
181186
struct tuple_size<tuple<THRUST_NS_QUALIFIER::null_type,
@@ -284,4 +289,5 @@ struct tuple_size<tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, THRUST_NS_QUALIFIER:
284289
: tuple_size<tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8>>
285290
{};
286291

292+
_CCCL_SUPPRESS_DEPRECATED_POP
287293
_LIBCUDACXX_END_NAMESPACE_STD

0 commit comments

Comments
 (0)