35 ::operator
delete(
start);
67 const void* first,
const size_t n);
79 const size_t n = position -
start;
109 template<>
inline void
113 if (positions.
size() == 0)
118 while (pos != lastpos)
125 if (positions.
size() != values.
size())
126 throw BCP_fatal_error(
"BCP_vec::update() called with unequal sizes.\n");
141 const size_t len = last - first;
142 memmove(
start, first, len *
sizeof(
int));
164 if (position + 1 !=
finish)
165 memmove(position, position + 1, ((
finish-position) - 1) *
sizeof(
int));
171 if (first != last && last !=
finish)
172 memmove(first, last, (
finish - last) *
sizeof(
int));
void deallocate()
Destroy the entries in the vector and free the memory allocated for the vector.
void insert_aux(iterator position, const_reference x)
insert x into the given position in the vector.
pos
position where the operator should be printed when printing the expression
iterator finish
Iterator pointing to right after the last entry in the vector.
reference operator[](const size_t i)
Return a reference to the i-th entry.
const int & const_reference
iterator begin()
Return an iterator to the beginning of the object.
void unchecked_update(const BCP_vec< int > &positions, const BCP_vec< T > &values)
Same as the previous method but without sanity checks.
void reserve(const size_t n)
Reallocate the object to make space for n entries.
void push_back(const_reference x)
Append x to the end of the vector.
BCP_vec< T > & operator=(const BCP_vec< T > &x)
Copy the contents of x into the object and return a reference the the object itself.
void construct(iterator pos)
void erase(iterator pos)
Erase the entry pointed to by pos.
iterator end_of_storage
Iterator pointing to right after the last memory location usable by the vector without reallocation...
void pop_back()
Delete the last entry.
iterator start
Iterator pointing to the beginning of the memory array where the vector is stored.
void update(const BCP_vec< int > &positions, const BCP_vec< T > &values)
Update those entries listed in positions to the given values.
void destroy_range(iterator first, iterator last)
BCP_vec()
The default constructor initializes the data members as 0 pointers.
void insert(iterator position, const void *first, const size_t num)
Insert num entries starting from memory location first into the vector from position pos...
void BCP_vec_sanity_check(BCP_vec< int >::const_iterator firstpos, BCP_vec< int >::const_iterator lastpos, const int maxsize)
A helper function to test whether a set positions is sane for a vector.
Currently there isn't any error handling in BCP.
size_t size() const
Return the current number of entries.
iterator end()
Return an iterator to the end of the object.
void unchecked_push_back(const_reference x)
Append x to the end of the vector.
void keep(iterator pos)
Keep only the entry pointed to by pos.
void assign(const void *x, const size_t num)
Copy num entries of type T starting at the memory location x into the object.
const int * const_iterator
void fint fint fint real fint real * x
void destroy(iterator pos)