From 37a638e54a58a43955281c3c0c76b7627d34f1e6 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Mon, 5 Dec 2022 18:32:17 +0100 Subject: [PATCH] Address review comments --- testing/vector.cu | 2 -- thrust/detail/vector_base.h | 4 ---- thrust/detail/vector_base.inl | 2 -- thrust/device_vector.h | 8 ++------ thrust/host_vector.h | 8 ++------ thrust/system/cpp/detail/vector.inl | 2 +- 6 files changed, 5 insertions(+), 21 deletions(-) diff --git a/testing/vector.cu b/testing/vector.cu index 269e3713e..b09a4b55c 100644 --- a/testing/vector.cu +++ b/testing/vector.cu @@ -40,7 +40,6 @@ void TestVectorBool(void) } DECLARE_UNITTEST(TestVectorBool); -#if THRUST_CPP_DIALECT >= 2011 template void TestVectorInitializerList(void) { @@ -65,7 +64,6 @@ void TestVectorInitializerList(void) ASSERT_EQUAL(v2[2], 3); } DECLARE_VECTOR_UNITTEST(TestVectorInitializerList); -#endif template void TestVectorFrontBack(void) diff --git a/thrust/detail/vector_base.h b/thrust/detail/vector_base.h index 025082e64..df2edad18 100644 --- a/thrust/detail/vector_base.h +++ b/thrust/detail/vector_base.h @@ -29,9 +29,7 @@ #include #include -#if THRUST_CPP_DIALECT >= 2011 #include -#endif #include THRUST_NAMESPACE_BEGIN @@ -127,7 +125,6 @@ template */ vector_base &operator=(const vector_base &v); - #if THRUST_CPP_DIALECT >= 2011 /*! Move assign operator moves from another vector_base. * \param v The vector_base to move. */ @@ -148,7 +145,6 @@ template * \param il The initializer_list. */ vector_base &operator=(std::initializer_list il); - #endif /*! Copy constructor copies from an exemplar vector_base with different * type. diff --git a/thrust/detail/vector_base.inl b/thrust/detail/vector_base.inl index cdb4bbaab..d9c29b0d2 100644 --- a/thrust/detail/vector_base.inl +++ b/thrust/detail/vector_base.inl @@ -195,7 +195,6 @@ template return *this; } // end vector_base::operator=() -#if THRUST_CPP_DIALECT >= 2011 template vector_base ::vector_base(std::initializer_list il) @@ -223,7 +222,6 @@ template return *this; } // end vector_base::operator=() -#endif template template diff --git a/thrust/device_vector.h b/thrust/device_vector.h index 3d67e70ca..9b97e8d70 100644 --- a/thrust/device_vector.h +++ b/thrust/device_vector.h @@ -26,9 +26,7 @@ #include #include -#if THRUST_CPP_DIALECT >= 2011 #include -#endif #include #include @@ -200,26 +198,24 @@ template > device_vector &operator=(const detail::vector_base &v) { Parent::operator=(v); return *this; } -#if THRUST_CPP_DIALECT >= 2011 /*! This constructor builds a \p device_vector from an intializer_list. * \param il The intializer_list. */ device_vector(std::initializer_list il) - :Parent(il.begin(), il.end()) {} + :Parent(il) {} /*! This constructor builds a \p device_vector from an intializer_list. * \param il The intializer_list. * \param alloc The allocator to use by this device_vector. */ device_vector(std::initializer_list il, const Alloc &alloc) - :Parent(il.begin(), il.end(), alloc) {} + :Parent(il, alloc) {} /*! Assign an \p intializer_list with a matching element type * \param il The intializer_list. */ device_vector &operator=(std::initializer_list il) { Parent::operator=(il); return *this; } -#endif /*! This constructor builds a \p device_vector from a range. * \param first The beginning of the range. diff --git a/thrust/host_vector.h b/thrust/host_vector.h index 44baea7f8..bb925ea9c 100644 --- a/thrust/host_vector.h +++ b/thrust/host_vector.h @@ -26,9 +26,7 @@ #include #include -#if THRUST_CPP_DIALECT >= 2011 #include -#endif #include #include @@ -221,26 +219,24 @@ template > host_vector &operator=(const detail::vector_base &v) { Parent::operator=(v); return *this; } -#if THRUST_CPP_DIALECT >= 2011 /*! This constructor builds a \p host_vector from an intializer_list. * \param il The intializer_list. */ host_vector(std::initializer_list il) - :Parent(il.begin(), il.end()) {} + :Parent(il) {} /*! This constructor builds a \p host_vector from an intializer_list. * \param il The intializer_list. * \param alloc The allocator to use by this host_vector. */ host_vector(std::initializer_list il, const Alloc &alloc) - :Parent(il.begin(), il.end(), alloc) {} + :Parent(il, alloc) {} /*! Assign an \p intializer_list with a matching element type * \param il The intializer_list. */ host_vector &operator=(std::initializer_list il) { Parent::operator=(il); return *this; } -#endif /*! This constructor builds a \p host_vector from a range. * \param first The beginning of the range. diff --git a/thrust/system/cpp/detail/vector.inl b/thrust/system/cpp/detail/vector.inl index bb987a213..02980c62a 100644 --- a/thrust/system/cpp/detail/vector.inl +++ b/thrust/system/cpp/detail/vector.inl @@ -97,6 +97,7 @@ template super_t::operator=(std::move(x)); return *this; } +#endif template vector @@ -118,7 +119,6 @@ template super_t::operator=(il); return *this; } -#endif template template