From ec5baea36da04c592b94f9dff8e2589bfaf97ebd Mon Sep 17 00:00:00 2001 From: Rong Ou Date: Tue, 25 Aug 2020 16:09:10 -0700 Subject: [PATCH] review feedback --- thrust/system/cuda/detail/transform_scan.h | 5 +++++ thrust/system/detail/generic/transform_scan.inl | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/thrust/system/cuda/detail/transform_scan.h b/thrust/system/cuda/detail/transform_scan.h index aad83c843..fbf70b0a7 100644 --- a/thrust/system/cuda/detail/transform_scan.h +++ b/thrust/system/cuda/detail/transform_scan.h @@ -50,8 +50,13 @@ transform_inclusive_scan(execution_policy &policy, TransformOp transform_op, ScanOp scan_op) { + // Use the input iterator's value type per https://wg21.link/P0571 using input_type = typename thrust::iterator_value::type; +#if THRUST_CPP_DIALECT < 2017 using result_type = typename std::result_of::type; +#else + using result_type = std::invoke_result_t; +#endif typedef typename iterator_traits::difference_type size_type; size_type num_items = static_cast(thrust::distance(first, last)); diff --git a/thrust/system/detail/generic/transform_scan.inl b/thrust/system/detail/generic/transform_scan.inl index 567bf92da..31053cd10 100644 --- a/thrust/system/detail/generic/transform_scan.inl +++ b/thrust/system/detail/generic/transform_scan.inl @@ -48,8 +48,13 @@ __host__ __device__ UnaryFunction unary_op, BinaryFunction binary_op) { + // Use the input iterator's value type per https://wg21.link/P0571 using InputType = typename thrust::iterator_value::type; +#if THRUST_CPP_DIALECT < 2017 using ValueType = typename std::result_of::type; +#else + using ValueType = std::invoke_result_t; +#endif thrust::transform_iterator _first(first, unary_op); thrust::transform_iterator _last(last, unary_op);