25 #include <thrust/detail/config.h> 26 #include <thrust/detail/memory_wrapper.h> 27 #include <thrust/detail/vector_base.h> 31 THRUST_NAMESPACE_BEGIN
50 template<
typename T,
typename Alloc = std::allocator<T> >
52 :
public detail::vector_base<T,Alloc>
55 typedef detail::vector_base<T,Alloc> Parent;
60 typedef typename Parent::size_type size_type;
61 typedef typename Parent::value_type value_type;
118 explicit host_vector(size_type n,
const value_type &value,
const Alloc &alloc)
119 :Parent(n,value,alloc) {}
136 #if THRUST_CPP_DIALECT >= 2011 142 :Parent(
std::move(v)) {}
150 :Parent(
std::move(v),alloc) {}
158 { Parent::operator=(v);
return *
this; }
160 #if THRUST_CPP_DIALECT >= 2011 166 { Parent::operator=(std::move(v));
return *
this; }
172 template<
typename OtherT,
typename OtherAlloc>
180 template<
typename OtherT,
typename OtherAlloc>
183 { Parent::operator=(v);
return *
this; }
188 template<
typename OtherT,
typename OtherAlloc>
196 template<
typename OtherT,
typename OtherAlloc>
199 { Parent::operator=(v);
return *
this;}
206 template<
typename OtherT,
typename OtherAlloc>
215 template<
typename OtherT,
typename OtherAlloc>
218 { Parent::operator=(v);
return *
this; }
224 template<
typename InputIterator>
227 :Parent(first, last) {}
234 template<
typename InputIterator>
236 host_vector(InputIterator first, InputIterator last,
const Alloc &alloc)
237 :Parent(first, last, alloc) {}
252 void resize(size_type new_size,
const value_type &x = value_type());
256 size_type size(
void)
const;
261 size_type max_size(
void)
const;
269 void reserve(size_type n);
274 size_type capacity(
void)
const;
279 void shrink_to_fit(
void);
299 const_reference operator[](size_type n)
const;
305 iterator begin(
void);
311 const_iterator begin(
void)
const;
317 const_iterator cbegin(
void)
const;
331 const_reverse_iterator rbegin(
void)
const;
338 const_reverse_iterator crbegin(
void)
const;
350 const_iterator end(
void)
const;
356 const_iterator cend(
void)
const;
368 const_reverse_iterator rend(
void)
const;
374 const_reverse_iterator crend(
void)
const;
380 const_reference front(
void)
const;
392 const_reference back(
void)
const;
408 const_pointer data(
void)
const;
417 bool empty(
void)
const;
422 void push_back(
const value_type &x);
439 iterator erase(iterator pos);
447 iterator erase(iterator first, iterator last);
455 iterator insert(iterator position,
const T &x);
463 void insert(iterator position, size_type n,
const T &x);
474 template<
typename InputIterator>
475 void insert(iterator position, InputIterator first, InputIterator last);
482 void assign(size_type n,
const T &x);
490 template<
typename InputIterator>
491 void assign(InputIterator first, InputIterator last);
496 allocator_type get_allocator(
void)
const;
497 #endif // end doxygen-only members 504 template<
typename T,
typename Alloc>
thrust::pointer< T, thrust::system::cpp::tag, thrust::tagged_reference< T, thrust::system::cpp::tag > > pointer
Definition: pointer.h:60
void swap(host_vector< T, Alloc > &a, host_vector< T, Alloc > &b)
Definition: host_vector.h:505
__host__ host_vector(size_type n, const Alloc &alloc)
Definition: host_vector.h:99
__host__ host_vector(host_vector &&v)
Definition: host_vector.h:141
__host__ host_vector(const host_vector< OtherT, OtherAlloc > &v)
Definition: host_vector.h:174
thrust::reference< T, thrust::system::cpp::tag > reference
Definition: pointer.h:98
__host__ host_vector(const host_vector &v)
Definition: host_vector.h:125
__host__ host_vector(size_type n, const value_type &value, const Alloc &alloc)
Definition: host_vector.h:118
Definition: optional.h:2876
__host__ host_vector(const std::vector< OtherT, OtherAlloc > &v)
Definition: host_vector.h:190
Definition: reverse_iterator.h:144
__host__ host_vector(const detail::vector_base< OtherT, OtherAlloc > &v)
Definition: host_vector.h:208
__host__ host_vector & operator=(const detail::vector_base< OtherT, OtherAlloc > &v)
Definition: host_vector.h:217
__host__ host_vector(host_vector &&v, const Alloc &alloc)
Definition: host_vector.h:149
__host__ host_vector(const Alloc &alloc)
Definition: host_vector.h:75
__host__ host_vector & operator=(const std::vector< OtherT, OtherAlloc > &v)
Definition: host_vector.h:198
__host__ host_vector(InputIterator first, InputIterator last)
Definition: host_vector.h:226
Definition: host_vector.h:51
__host__ host_vector & operator=(const host_vector &v)
Definition: host_vector.h:157
__host__ ~host_vector(void)
Definition: host_vector.h:83
__host__ host_vector & operator=(host_vector &&v)
Definition: host_vector.h:165
__host__ host_vector(InputIterator first, InputIterator last, const Alloc &alloc)
Definition: host_vector.h:236
__host__ host_vector & operator=(const host_vector< OtherT, OtherAlloc > &v)
Definition: host_vector.h:182
__host__ host_vector(size_type n)
Definition: host_vector.h:90
__host__ host_vector(size_type n, const value_type &value)
Definition: host_vector.h:108
__host__ host_vector(const host_vector &v, const Alloc &alloc)
Definition: host_vector.h:133
__host__ host_vector(void)
Definition: host_vector.h:68