hpx/compute/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)

Effects: x.swap(y);.

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

Public Types

template<>
using value_type = T

Member types (FIXME: add reference to std.

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

Public Functions

vector(Allocator const &alloc = Allocator())
vector(size_type count, T const &value, Allocator const &alloc = Allocator())
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>
vector(InIter first, InIter last, Allocator const &alloc)
vector(vector const &other)
vector(vector const &other, Allocator const &alloc)
vector(vector &&other)
vector(vector &&other, Allocator const &alloc)
vector(std::initializer_list<T> init, Allocator const &alloc)
~vector()
vector &operator=(vector const &other)
vector &operator=(vector &&other)
allocator_type get_allocator() const

Returns the allocator associated with the container.

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

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 dereferenceable in that case).

const_pointer data() const

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 dereferenceable in that case).

T *device_data() const

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

std::size_t size() const
std::size_t capacity() const
bool empty() const

Returns: size() == 0.

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.

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.

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

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

Complexity: Constant time.

void clear()

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.

Private Types

typedef traits::allocator_traits<Allocator> alloc_traits

Private Members

size_type size_
size_type capacity_
allocator_type alloc_
pointer data_