16template<>
inline void BCP_vec<bool>::destroy(iterator pos)
20template<>
inline void BCP_vec<bool>::destroy_range(iterator first, iterator last)
24template<>
inline void BCP_vec<bool>::construct(iterator pos)
29template<>
inline void BCP_vec<bool>::construct(iterator pos, const_reference x)
40 ::operator
delete(
start);
72 const void* first,
const size_t n);
84 const size_t n = position -
start;
114template<>
inline void
118 if (positions.
size() == 0)
123 while (pos != lastpos)
131 if (positions.
size() != values.
size())
132 throw BCP_fatal_error(
"BCP_vec::update() called with unequal sizes.\n");
147 const size_t len = last - first;
148 std::memmove(
start, first, len *
sizeof(
bool));
170 if (position + 1 !=
finish)
171 std::memmove(position, position + 1, ((
finish-position) - 1) *
sizeof(
bool));
177 if (first != last && last !=
finish)
178 std::memmove(first, last, (
finish - last) *
sizeof(
bool));
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.
const BCP_cut ** const_iterator
void deallocate()
Destroy the entries in the vector and free the memory allocated for the vector.
BCP_vec(const size_t n, const_reference value)
void unchecked_update(const BCP_vec< int > &positions, const BCP_vec< bool > &values)
void pop_back()
Delete the last entry.
const BCP_cut *& const_reference
void push_back(const_reference x)
Append x to the end of the vector.
void unchecked_push_back(const_reference x)
Append x to the end of the vector.
iterator end()
Return an iterator to the end of the object.
size_t size() const
Return the current number of entries.
void keep(iterator pos)
Keep only the entry pointed to by pos.
reference operator[](const size_t i)
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 erase(iterator pos)
Erase the entry pointed to by pos.
void insert_aux(iterator position, const_reference x)
iterator begin()
Return an iterator to the beginning of the object.
void update(const BCP_vec< int > &positions, const BCP_vec< T > &values)
Update those entries listed in positions to the given values.
void unchecked_update(const BCP_vec< int > &positions, const BCP_vec< T > &values)
Same as the previous method but without sanity checks.
BCP_vec()
The default constructor initializes the data members as 0 pointers.
void reserve(const size_t n)
Reallocate the object to make space for n entries.
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 assign(const void *x, const size_t num)
Copy num entries of type T starting at the memory location x into the object.
void insert_aux(iterator position, const_reference x)
insert x into the given position in the vector.