Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Dec 5, 2022
1 parent 12112f5 commit 37a638e
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 21 deletions.
2 changes: 0 additions & 2 deletions testing/vector.cu
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ void TestVectorBool(void)
}
DECLARE_UNITTEST(TestVectorBool);

#if THRUST_CPP_DIALECT >= 2011
template <class Vector>
void TestVectorInitializerList(void)
{
Expand All @@ -65,7 +64,6 @@ void TestVectorInitializerList(void)
ASSERT_EQUAL(v2[2], 3);
}
DECLARE_VECTOR_UNITTEST(TestVectorInitializerList);
#endif

template <class Vector>
void TestVectorFrontBack(void)
Expand Down
4 changes: 0 additions & 4 deletions thrust/detail/vector_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
#include <thrust/detail/config.h>
#include <thrust/detail/contiguous_storage.h>

#if THRUST_CPP_DIALECT >= 2011
#include <initializer_list>
#endif
#include <vector>

THRUST_NAMESPACE_BEGIN
Expand Down Expand Up @@ -127,7 +125,6 @@ template<typename T, typename Alloc>
*/
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.
*/
Expand All @@ -148,7 +145,6 @@ template<typename T, typename Alloc>
* \param il The initializer_list.
*/
vector_base &operator=(std::initializer_list<T> il);
#endif

/*! Copy constructor copies from an exemplar vector_base with different
* type.
Expand Down
2 changes: 0 additions & 2 deletions thrust/detail/vector_base.inl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ template<typename T, typename Alloc>
return *this;
} // end vector_base::operator=()

#if THRUST_CPP_DIALECT >= 2011
template<typename T, typename Alloc>
vector_base<T,Alloc>
::vector_base(std::initializer_list<T> il)
Expand Down Expand Up @@ -223,7 +222,6 @@ template<typename T, typename Alloc>

return *this;
} // end vector_base::operator=()
#endif

template<typename T, typename Alloc>
template<typename IteratorOrIntegralType>
Expand Down
8 changes: 2 additions & 6 deletions thrust/device_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
#include <thrust/detail/vector_base.h>
#include <thrust/device_allocator.h>

#if THRUST_CPP_DIALECT >= 2011
#include <initializer_list>
#endif
#include <vector>
#include <utility>

Expand Down Expand Up @@ -200,26 +198,24 @@ template<typename T, typename Alloc = thrust::device_allocator<T> >
device_vector &operator=(const detail::vector_base<OtherT,OtherAlloc> &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<T> 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<T> 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<T> il)
{ Parent::operator=(il); return *this; }
#endif

/*! This constructor builds a \p device_vector from a range.
* \param first The beginning of the range.
Expand Down
8 changes: 2 additions & 6 deletions thrust/host_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
#include <thrust/detail/memory_wrapper.h>
#include <thrust/detail/vector_base.h>

#if THRUST_CPP_DIALECT >= 2011
#include <initializer_list>
#endif
#include <vector>
#include <utility>

Expand Down Expand Up @@ -221,26 +219,24 @@ template<typename T, typename Alloc = std::allocator<T> >
host_vector &operator=(const detail::vector_base<OtherT,OtherAlloc> &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<T> 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<T> 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<T> il)
{ Parent::operator=(il); return *this; }
#endif

/*! This constructor builds a \p host_vector from a range.
* \param first The beginning of the range.
Expand Down
2 changes: 1 addition & 1 deletion thrust/system/cpp/detail/vector.inl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ template<typename T, typename Allocator>
super_t::operator=(std::move(x));
return *this;
}
#endif

template<typename T, typename Allocator>
vector<T,Allocator>
Expand All @@ -118,7 +119,6 @@ template<typename T, typename Allocator>
super_t::operator=(il);
return *this;
}
#endif

template<typename T, typename Allocator>
template<typename OtherT, typename OtherAllocator>
Expand Down

0 comments on commit 37a638e

Please sign in to comment.