From 3c68488a1e3d8717a1534aca3f8c52a0ff5fa30e Mon Sep 17 00:00:00 2001 From: Georgy Evtushenko Date: Thu, 26 Aug 2021 21:53:10 +0300 Subject: [PATCH] Fix default constructor of counting iterator --- testing/counting_iterator.cu | 8 ++++++++ thrust/iterator/counting_iterator.h | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/testing/counting_iterator.cu b/testing/counting_iterator.cu index eede510fc..ebefe4d64 100644 --- a/testing/counting_iterator.cu +++ b/testing/counting_iterator.cu @@ -8,6 +8,14 @@ THRUST_DISABLE_MSVC_POSSIBLE_LOSS_OF_DATA_WARNING_BEGIN +template +void TestCountingDefaultConstructor(void) +{ + thrust::counting_iterator iter0; + ASSERT_EQUAL(*iter0, T{}); +} +DECLARE_GENERIC_UNITTEST(TestCountingDefaultConstructor); + void TestCountingIteratorCopyConstructor(void) { thrust::counting_iterator iter0(100); diff --git a/thrust/iterator/counting_iterator.h b/thrust/iterator/counting_iterator.h index a7ef2ec7c..f66cb97ef 100644 --- a/thrust/iterator/counting_iterator.h +++ b/thrust/iterator/counting_iterator.h @@ -144,11 +144,11 @@ template