hpx/compute_local/vector.hpp#

Defined in header hpx/compute_local/vector.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace compute

Functions

template<typename T, typename Allocator>
void swap(vector<T, Allocator> &x, vector<T, Allocator> &y) noexcept#

Effects: x.swap(y);.

template<typename T, typename Allocator = std::allocator<T>>
class vector#

Public Types

using value_type = T#

Member types (FIXME: add reference to std.

using allocator_type = Allocator#
using access_target = typename alloc_traits::access_target#
using size_type = std::size_t#
using difference_type = std::ptrdiff_t#
using reference = typename alloc_traits::reference#
using const_reference = typename alloc_traits::const_reference#
using pointer = typename alloc_traits::pointer#
using const_pointer = typename alloc_traits::const_pointer#
using iterator = detail::iterator<T, Allocator>#
using const_iterator = detail::iterator<T const, Allocator>#
using reverse_iterator = detail::reverse_iterator<T, Allocator>#
using const_reverse_iterator = detail::const_reverse_iterator<T, Allocator>#

Public Functions

inline explicit vector(Allocator const &alloc = Allocator())#
inline vector(size_type count, T const &value, Allocator const &alloc = Allocator())#
inline explicit vector(size_type count, Allocator const &alloc = Allocator())#
template<typename InIter, typename Enable = typename std::enable_if<hpx::traits::is_input_iterator<InIter>::value>::type>
inline vector(InIter first, InIter last, Allocator const &alloc)#
inline vector(vector const &other)#
inline vector(vector const &other, Allocator const &alloc)#
inline vector(vector &&other) noexcept#
inline vector(vector &&other, Allocator const &alloc)#
inline vector(std::initializer_list<T> init, Allocator const &alloc)#
inline ~vector()#
inline vector &operator=(vector const &other)#
inline vector &operator=(vector &&other) noexcept#
inline allocator_type get_allocator() const noexcept#

Returns the allocator associated with the container.

inline reference operator[](size_type pos)#
inline const_reference operator[](size_type pos) const#
inline pointer data() noexcept#

Returns pointer to the underlying array serving as element storage. The pointer is such that range [data(); data() + size()) is always a valid range, even if the container is empty (data() is not dereference-able in that case).

inline const_pointer data() const noexcept#

Returns pointer to the underlying array serving as element storage. The pointer is such that range [data(); data() + size()) is always a valid range, even if the container is empty (data() is not dereference-able in that case).

inline T *device_data() const noexcept#

Returns a raw pointer corresponding to the address of the data allocated on the device.

inline std::size_t size() const noexcept#
inline std::size_t capacity() const noexcept#
inline bool empty() const noexcept#

Returns: size() == 0.

inline void resize(size_type, T const&)#

Effects: If size <= size(), equivalent to calling pop_back() size() - size times. If size() < size, appends size - size() copies of val to the sequence.

Requires: T shall be CopyInsertable into *this.

Remarks: If an exception is thrown there are no effects.

inline iterator begin() noexcept#
inline iterator end() noexcept#
inline const_iterator cbegin() const noexcept#
inline const_iterator cend() const noexcept#
inline const_iterator begin() const noexcept#
inline const_iterator end() const noexcept#
inline void swap(vector &other) noexcept#

Effects: Exchanges the contents and capacity() of *this with that of x.

Complexity: Constant time.

inline void clear() noexcept#

Effects: Erases all elements in the range [begin(),end()). Destroys all elements in ‘a’. Invalidates all references, pointers, and iterators referring to the elements of a and may invalidate the past-the-end iterator.

Post: a.empty() returns true.

Complexity: Linear.

Public Static Functions

static inline void resize(size_type)#

Effects: If size <= size(), equivalent to calling pop_back() size()

  • size times. If size() < size, appends size - size() default-inserted elements to the sequence.

Requires: T shall be MoveInsertable and DefaultInsertable into *this.

Remarks: If an exception is thrown other than by the move constructor of a non-CopyInsertable T there are no effects.

Private Types

using alloc_traits = traits::allocator_traits<Allocator>#

Private Members

size_type size_#
size_type capacity_#
allocator_type alloc_#
pointer data_#