#include <DataList.h>
Public Types | |
typedef BASE | DataList_BASE |
typedef BASE | DVL_BASE |
typedef BASE::PtrList | PtrList |
typedef BASE::PtrList | BaseContainer |
typedef T *& | reference |
typedef T *const & | const_reference |
typedef BASE::size_type | size_type |
typedef BASE::difference_type | difference_type |
typedef T * | value_type |
typedef BASE::allocator_type | allocator_type |
typedef T ** | pointer |
typedef T *const * | const_pointer |
typedef const T * | const_value_type |
typedef T | base_value_type |
typedef DataModel_detail::ElementProxy < DataList > | ElementProxy |
typedef DataModel_detail::const_iterator < DataList > | const_iterator |
Standard const_iterator . | |
typedef DataModel_detail::iterator < DataList > | iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
Standard const_reverse_iterator . | |
typedef std::reverse_iterator < iterator > | reverse_iterator |
typedef DataList< T, BASE > | self |
A helper typedef. | |
Public Member Functions | |
template<typename BinaryPredicate > | |
void | unique (BinaryPredicate p) |
Remove consecutive elements satisfying a predicate. | |
Constructors, destructors, assignment. | |
DataList (SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS) | |
Default constructor. | |
DataList (size_type n, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS) | |
Sized constructor. | |
template<class InputIterator > | |
DataList (InputIterator first, InputIterator last, SG::OwnershipPolicy ownPolicy=SG::VIEW_ELEMENTS) | |
Copy constructor. | |
DataList & | operator= (const DataList &rhs) |
Assignment operator. | |
template<class InputIterator > | |
void | assign (InputIterator first, InputIterator last) |
Assign from iterators. | |
Element access. | |
const T * | front () const |
Access the first element in the collection as an rvalue. | |
const T * | back () const |
Access the last element in the collection as an rvalue. | |
ElementProxy | front () |
Access the first element in the collection as an lvalue. | |
ElementProxy | back () |
Access the last element in the collection as an lvalue. | |
Iterator creation. | |
const_iterator | begin () const |
Return a const_iterator pointing at the beginning of the collection. | |
const_iterator | end () const |
Return a const_iterator pointing past the end of the collection. | |
iterator | begin () |
Return an iterator pointing at the beginning of the collection. | |
iterator | end () |
Return an iterator pointing past the end of the collection. | |
const_reverse_iterator | rbegin () const |
Return a const_reverse_iterator pointing past the end of the collection. | |
const_reverse_iterator | rend () const |
Return a const_reverse_iterator pointing at the beginning of the collection. | |
reverse_iterator | rbegin () |
Return a reverse_iterator pointing past the end of the collection. | |
reverse_iterator | rend () |
Return a reverse_iterator pointing at the beginning of the collection. | |
Insertion operations. | |
void | push_front (value_type pElem) |
Add an element at the beginning of the collection. | |
void | push_back (value_type pElem) |
Add an element to the end of the collection. | |
iterator | insert (iterator position, value_type pElem) |
Add a new element to the collection. | |
template<class InputIterator > | |
void | insert (iterator position, InputIterator first, InputIterator last) |
Add a group of new elements to the collection. | |
Erasure operations. | |
iterator | erase (iterator position) |
Remove element at a given position. | |
iterator | erase (iterator first, iterator last) |
Remove a range of elements. | |
void | pop_back () |
Remove the last element from the collection. | |
void | pop_front () |
Remove the first element from the collection. | |
void | clear () |
Erase all the elements in the collection. | |
List operations. | |
void | splice (iterator position, DataList &l) |
Insert contents of another list. | |
void | splice (iterator position, DataList &l, iterator i) |
Insert element from another list. | |
void | splice (iterator position, DataList &l, iterator first, iterator last) |
Insert range from another list. | |
void | remove (const value_type &value) |
Remove all elements equal to value. | |
template<typename PREDICATE > | |
void | remove_if (PREDICATE p) |
Remove all elements satisfying a predicate. | |
void | unique () |
Remove consecutive duplicate elements. | |
template<typename BINARY_PREDICATE > | |
void | unique (BINARY_PREDICATE p) |
Remove consecutive elements satisfying a predicate. | |
void | merge (DataList &l) |
Merge sorted lists. | |
template<typename COMPARE > | |
void | merge (DataList &l, COMPARE predicate) |
Merge sorted lists according to comparison function. | |
void | reverse () |
Reverse the elements in list. | |
Size and capacity. | |
size_type | size () const |
Returns the number of elements in the collection. | |
size_type | max_size () const |
Returns the size() of the largest possible collection. | |
void | resize (size_type sz) |
Resizes the collection to the specified number of elements. | |
bool | empty () const |
Returns true if the collection is empty. | |
Public Attributes | |
ROOT_SELECTION_NS::MemberAttributes < kTransient > | m_isMostDerived |
Declare the transient variable(s):. | |
Static Public Attributes | |
static const bool | has_virtual = BASE::has_virtual |
Internal operations. | |
| |
class | DataModel_detail::ElementProxy< DataList > |
class | ConstDataList< DataList > |
void | test2_assignelement1 () |
void | resortAux (iterator beg, iterator end) |
Reset indices / reorder aux data after elements have been permuted. | |
void | testInsert (const char *op) |
Test if we can insert; raise an exception if not. | |
void | testInsertOol (const char *op) |
Test if we can insert; raise an exception if not. | |
void | clearMostDerived () |
Clear m_isMostDerived for this instance and for all bases. | |
virtual void | setMostDerived () |
Set m_isMostDerived for this instance and clear it for all bases. | |
Swap and sort. | |
| |
void | swap (DataList &rhs) |
Swap this collection with another. | |
void | sort () |
Sort the container. | |
template<class COMPARE > | |
void | sort (COMPARE comp) |
Sort the container with a user-specified comparison operator. | |
static void | iter_swap (iterator a, iterator b) |
Swap the referents of two DataVector iterators. | |
Non-standard operations. | |
| |
void | swapElement (iterator pos, value_type newElem, reference oldElem) |
Swap one element out of the container. | |
virtual const DataModel_detail::DVLInfoBase & | dvlinfo_v () const |
Return the DV/DL info struct for this class. | |
const PtrList & | stdcont () const |
Return the underlying std::list of the container. | |
SG::OwnershipPolicy | ownPolicy () const |
Return the ownership policy setting for this container. | |
void | clear (SG::OwnershipPolicy ownPolicy) |
Erase all the elements in the collection, and reset the ownership mode. | |
static const DataModel_detail::DVLInfoBase & | dvlinfo () |
Return the DV/DL info struct for this class. |
This is used for the case where T
derives from other classes. The list of pointers is actually held in the (unique) base class of the hierarchy.
See the file comments for full details.
typedef T DataList< T, BASE >::base_value_type |
The T
value used as the template parameter. Note that this is different from value_type
(that's T*
).
typedef DataModel_detail::ElementProxy<DataList> DataList< T, BASE >::ElementProxy |
This type is used to proxy lvalue accesses to DataList
elements, in order to handle ownership.
typedef DataModel_detail::iterator<DataList> DataList< T, BASE >::iterator |
Standard iterator
. Note that lvalue references here will yield an ElementProxy
, not a reference
.
typedef BASE::PtrList DataList< T, BASE >::PtrList |
This is the type of the underlying std::list
(what stdcont
returns).
Reimplemented in DataList_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataList_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataList_detail::VirtBases< B1, B2, B3 >.
typedef std::reverse_iterator<iterator> DataList< T, BASE >::reverse_iterator |
Standard reverse_iterator
. Note that lvalue references here will yield an ElementProxy
, not a reference
.
EXIT_ROOT_SELECTION_NS DataList< T, BASE >::DataList | ( | SG::OwnershipPolicy | ownPolicy = SG::OWN_ELEMENTS |
) | [inline, explicit] |
Default constructor.
ownPolicy | The ownership mode for the container. |
By default, a DataList
will own its elements. To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
ownPolicy | The ownership mode for the container. |
By default, a DataList
will own its elements. To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
Note that we do the complete initialization here in the derived class, using the default constructors for the base classes. The reason for this is to be able to deal nicely with the virtual derivation case. We can arrange to call the proper base class from here to get things initialized in the virtual derivation case. But then anyone who derives from us must also know to explicitly reference that base class. Doing the initialization explicitly here means that other classes who derive from us need only know about the most derived DataList class.
DataList< T, BASE >::DataList | ( | size_type | n, | |
SG::OwnershipPolicy | ownPolicy = SG::OWN_ELEMENTS | |||
) | [inline, explicit] |
Sized constructor.
n | The size of the container. | |
ownPolicy | The ownership mode for the container. |
Note that unlike the standard list constructor, you can't specify an initial value here. The container will be initialized with 0's.
By default, a DataList
will own its elements. To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
n | The size of the container. | |
ownPolicy | The ownership mode for the container. |
Note that unlike the standard list constructor, you can't specify an initial value here. The container will be initialized with 0's.
By default, a DataList
will own its elements. To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
Note that we do the complete initialization here in the derived class, using the default constructors for the base classes. The reason for this is to be able to deal nicely with the virtual derivation case. We can arrange to call the proper base class from here to get things initialized in the virtual derivation case. But then anyone who derives from us must also know to explicitly reference that base class. Doing the initialization explicitly here means that other classes who derive from us need only know about the most derived DataList class.
DataList< T, BASE >::DataList | ( | InputIterator | first, | |
InputIterator | last, | |||
SG::OwnershipPolicy | ownPolicy = SG::VIEW_ELEMENTS | |||
) | [inline] |
Copy constructor.
Constructor from iterators.
rhs | The container from which to copy. |
This is a `shallow' copy; the new container will not own its elements. Constructor from iterators.
first | The start of the range to put in the new container. | |
last | The end of the range to put in the new container. | |
ownPolicy | The ownership mode for the container. |
By default, a DataList
will own its elements (and take ownership of the pointers passed to this constructor). To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
first | The start of the range to put in the new container. | |
last | The end of the range to put in the new container. | |
ownPolicy | The ownership mode for the container. |
By default, a DataList
will own its elements (and take ownership of the pointers passed to this constructor). To avoid this, pass SG::VIEW_ELEMENTS
for ownPolicy.
Note that we do the complete initialization here in the derived class, using the default constructors for the base classes. The reason for this is to be able to deal nicely with the virtual derivation case. We can arrange to call the proper base class from here to get things initialized in the virtual derivation case. But then anyone who derives from us must also know to explicitly reference that base class. Doing the initialization explicitly here means that other classes who derive from us need only know about the most derived DataList class.
void DataList< T, BASE >::assign | ( | InputIterator | first, | |
InputIterator | last | |||
) | [inline] |
Assign from iterators.
first | The start of the range to put in the container. | |
last | The end of the range to put in the container. |
Any existing owned elements will be released. The DataList's
ownership policy determines whether it will take ownership of the new elements.
DataList< T, BASE >::ElementProxy DataList< T, BASE >::back | ( | ) | [inline] |
Access the last element in the collection as an lvalue.
No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
Access the last element in the collection as an rvalue.
No checking is done to ensure that the container is not empty. Note that we return a const
T*
rather than a reference.
DataList< T, BASE >::iterator DataList< T, BASE >::begin | ( | ) | [inline] |
Return an iterator
pointing at the beginning of the collection.
iterator
.Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
DataList< T, BASE >::const_iterator DataList< T, BASE >::begin | ( | ) | const [inline] |
Return a const_iterator
pointing at the beginning of the collection.
const_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
void DataList< T, BASE >::clear | ( | SG::OwnershipPolicy | ownPolicy | ) |
Erase all the elements in the collection, and reset the ownership mode.
ownPolicy | The new ownership policy of the container. |
If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
Erase all the elements in the collection.
If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
Clear m_isMostDerived
for this instance and for all bases.
Called from the constructor after setting m_isMostDerived
.
Reimplemented in DataList_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataList_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataList_detail::VirtBases< B1, B2, B3 >.
const DataModel_detail::DVLInfoBase & DataList< T, BASE >::dvlinfo | ( | ) | [inline, static] |
Return the DV/DL info struct for this class.
This can be used to make sure that it's instantiated.
const DataModel_detail::DVLInfoBase & DataList< T, BASE >::dvlinfo_v | ( | ) | const [inline, virtual] |
Return the DV/DL info struct for this class.
This can be used to make sure that it's instantiated.
Reimplemented in DataList_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataList_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataList_detail::VirtBases< B1, B2, B3 >.
Return an iterator
pointing past the end of the collection.
iterator
.Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
DataList< T, BASE >::const_iterator DataList< T, BASE >::end | ( | ) | const [inline] |
Return a const_iterator
pointing past the end of the collection.
const_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
DataList< T, BASE >::iterator DataList< T, BASE >::erase | ( | iterator | first, | |
iterator | last | |||
) | [inline] |
Remove a range of elements.
first | Iterator pointing to the first element to be removed. | |
last | Iterator pointing one past the last element to be removed. |
end()
).If the container owns its elements, then the removed elements will be deleted. Any duplicates will be removed in this process, but don't rely on this.
DataList< T, BASE >::iterator DataList< T, BASE >::erase | ( | iterator | position | ) | [inline] |
Remove element at a given position.
position | Iterator pointing to the element to be removed. |
end()
).If the container owns its elements, then the pointed-to element will be deleted.
DataList< T, BASE >::ElementProxy DataList< T, BASE >::front | ( | ) | [inline] |
Access the first element in the collection as an lvalue.
No checking is done to ensure that the container is not empty. Note that we return a proxy object rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
Access the first element in the collection as an rvalue.
No checking is done to ensure that the container is not empty. Note that we return a const
T*
rather than a reference.
void DataList< T, BASE >::insert | ( | iterator | position, | |
InputIterator | first, | |||
InputIterator | last | |||
) | [inline] |
Add a group of new elements to the collection.
position | Iterator before which the element will be added. | |
first | The start of the range to put in the container. | |
last | The end of the range to put in the container. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataList
in the hierarchy.
DataList< T, BASE >::iterator DataList< T, BASE >::insert | ( | iterator | position, | |
value_type | pElem | |||
) | [inline] |
Add a new element to the collection.
position | Iterator before which the element will be added. | |
pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataList
in the hierarchy.
void DataList< T, BASE >::iter_swap | ( | iterator | a, | |
iterator | b | |||
) | [inline, static] |
Swap the referents of two DataVector
iterators.
a | The first iterator for the swap. | |
b | The second iterator for the swap/ |
void DataList< T, BASE >::merge | ( | DataList< T, BASE > & | l, | |
COMPARE | predicate | |||
) | [inline] |
Merge sorted lists according to comparison function.
l | Sorted list to merge. | |
predicate | Comparison function defining a sort order (which must be strictly weak ordering). |
Assumes that both l and this DataList
are sorted according to COMPARE predicate. Merges elements of l into this list in sorted order, leaving l empty when complete. Elements in this list precede elements in x that are equivalent according to StrictWeakOrdering().
l | Sorted list to merge. | |
COMPARE | Comparison function defining sort order (which must be strictly weak ordering). |
Assumes that both l and this DataList
are sorted according to COMPARE predicate. Merges elements of l into this list in sorted order, leaving l empty when complete. Elements in this list precede elements in x that are equivalent according to StrictWeakOrdering().
void DataList< T, BASE >::merge | ( | DataList< T, BASE > & | l | ) | [inline] |
Merge sorted lists.
l | Sorted list to merge. |
Assumes that both l and this list are sorted according to operator<(). Merges elements of l into this list in sorted order, leaving l empty when complete. Elements in this list precede elements in l that are equal.
l | Sorted list to merge. |
Assumes that both l and this list are sorted according to operator<()
. Merges elements of l into this list in sorted order, leaving l empty when complete. Elements in this list precede elements in l that are equal.
DataList< T, BASE > & DataList< T, BASE >::operator= | ( | const DataList< T, BASE > & | rhs | ) | [inline] |
Assignment operator.
rhs | The DataList from which to assign. |
This is a `shallow' copy; after the completion of this, the DataList
will not own its elements. Any elements it owned prior to this call will be released.
Note: this method may only be called using the most derived DataList
in the hierarchy.
rhs | The DataList from which to assign. |
This is a `shallow' copy; after the completion of this, the DataList will not own its elements. Any elements it owned prior to this call will be released.
Note: this method may only be called using the most derived DataList
in the hierarchy.
void DataList< T, BASE >::pop_back | ( | ) |
Remove the last element from the collection.
If the container owns its elements, then the removed element will be deleted.
void DataList< T, BASE >::pop_front | ( | ) |
Remove the first element from the collection.
If the container owns its elements, then the removed element will be deleted.
void DataList< T, BASE >::push_back | ( | value_type | pElem | ) | [inline] |
Add an element to the end of the collection.
pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataList
in the hierarchy.
void DataList< T, BASE >::push_front | ( | value_type | pElem | ) | [inline] |
Add an element at the beginning of the collection.
Add an element to the beginning of the collection.
pElem | The element to add to the collection. |
The container's ownership policy will determine if it takes ownership of the new element.
Note: this method may only be called using the most derived DataList
in the hierarchy.
DataList< T, BASE >::reverse_iterator DataList< T, BASE >::rbegin | ( | ) | [inline] |
Return a reverse_iterator
pointing past the end of the collection.
reverse_iterator
.Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
DataList< T, BASE >::const_reverse_iterator DataList< T, BASE >::rbegin | ( | ) | const [inline] |
Return a const_reverse_iterator
pointing past the end of the collection.
const_reverse_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
void DataList< T, BASE >::remove | ( | const value_type & | value | ) | [inline] |
Remove all elements equal to value.
value | The value to remove. |
Removes every element in the list equal to value. Remaining elements stay in list order.
void DataList< T, BASE >::remove_if | ( | PREDICATE | pred | ) | [inline] |
Remove all elements satisfying a predicate.
p | Unary predicate function or object. |
Removes every element in the list for which the predicate returns true. Remaining elements stay in list order.
pred | Unary predicate function or object. |
Removes every element in the list for which the predicate returns true. Remaining elements stay in list order.
DataList< T, BASE >::reverse_iterator DataList< T, BASE >::rend | ( | ) | [inline] |
Return a reverse_iterator
pointing at the beginning of the collection.
reverse_iterator
.Note that dereferencing the iterator will yield a proxy rather than a reference; the proxy will handle deleting an owned element if it's assigned to.
DataList< T, BASE >::const_reverse_iterator DataList< T, BASE >::rend | ( | ) | const [inline] |
Return a const_reverse_iterator
pointing at the beginning of the collection.
const_reverse_iterator
.Note that dereferencing the iterator will yield a const
T*
rather than a reference.
void DataList< T, BASE >::resize | ( | size_type | sz | ) |
Resizes the collection to the specified number of elements.
sz | The new size of the collection. |
Note that this function differs from the standard in that it does not allow specifying the value of any inserted elements. They will always be 0.
If the container is shrunk, elements will be deleted as with erase()
.
void DataList< T, BASE >::resortAux | ( | iterator | beg, | |
iterator | end | |||
) | [inline] |
Reset indices / reorder aux data after elements have been permuted.
beg | Start of the range of elements to process. | |
end | End of the range of elements to process. |
This is a no-op for DataList
.
Reverse the elements in list.
Reverse the order of elements in the list in linear time.
void DataList< T, BASE >::setMostDerived | ( | ) | [inline, protected, virtual] |
Set m_isMostDerived
for this instance and clear it for all bases.
Called from testInsert
if the test fails. The flag may not have been set if this container was made via copy construction, so set it appropriately now so we can test again.
Reimplemented in DataList_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataList_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataList_detail::VirtBases< B1, B2, B3 >.
void DataList< T, BASE >::sort | ( | COMPARE | comp | ) | [inline] |
Sort the container with a user-specified comparison operator.
comp | Functional to compare two values. |
Sort the container.
This just sorts by pointer value, so it's probably not very useful.
void DataList< T, BASE >::splice | ( | iterator | position, | |
DataList< T, BASE > & | l, | |||
iterator | first, | |||
iterator | last | |||
) | [inline] |
Insert range from another list.
position | Iterator referencing the element to insert before. | |
l | Source list. | |
first | Iterator referencing the start of range in l. | |
last | Iterator referencing the end of range in l. |
Removes elements in the range [first, last ) and inserts them before position in constant time.
Undefined if position is in [first, last ).
void DataList< T, BASE >::splice | ( | iterator | position, | |
DataList< T, BASE > & | l, | |||
iterator | i | |||
) | [inline] |
Insert element from another list.
position | Iterator referencing the element to insert before. | |
l | Source list. | |
i | Iterator referencing the element to move. |
Removes the element in list l referenced by i and inserts it into the current list before position.
void DataList< T, BASE >::splice | ( | iterator | position, | |
DataList< T, BASE > & | l | |||
) | [inline] |
Insert contents of another list.
position | Iterator referencing the element to insert before. | |
l | Source list. |
The elements of l are inserted in constant time in front of the element referenced by position. l becomes an empty list.
const PtrList & DataList< T, BASE >::stdcont | ( | ) | const |
Return the underlying std::list
of the container.
std::list
actually holding the collection.Note that DataList<T>::stdcont
does not necessarily return a std::list<T*>
if DataList
inheritance is being used.
void DataList< T, BASE >::swapElement | ( | iterator | pos, | |
value_type | newElem, | |||
reference | oldElem | |||
) | [inline] |
Swap one element out of the container.
pos | The element in the container to swap. | |
newElem | New element to put in the container. May be 0. | |
oldElem | Reference to receive the element removed from the container. |
Reference oldElem is initialized with element pos of the collection (no bounds checking). Then element index is set to newElem
. If the collection owns its elements, then it will take ownership of newElem and release (without deleting) the element returned through oldElem.
Note: this method may only be called using the most derived DataList
in the hierarchy.
Test if we can insert; raise an exception if not.
op | Description of the attempted operation. |
In order to maintain type-safety, we can only allow insertions using the most-derived instance of DataList
. This checks this by testing the m_isMostDerived
, which is set by the constructors to true only for the most-derived instance. If the test fails, we call to potentially out-of-line code to continue.
void DataList< T, BASE >::testInsertOol | ( | const char * | op | ) | [inline] |
Test if we can insert; raise an exception if not.
op | Description of the attempted operation. |
This continues the test of testInsert
. There is one case where m_isMostDerived
may not be set correctly. If this container was made via copy construction, then all the m_isMostDerived
flags will be false. So we call setMostDerived
to set the flags correctly and test again. If the test fails again, then we raise an exception.
void DataList< T, BASE >::unique | ( | BinaryPredicate | p | ) | [inline] |
Remove consecutive elements satisfying a predicate.
BinaryPredicate | Binary predicate function or object. |
For each consecutive set of elements [first,last) that satisfy predicate(first,i) where i is an iterator in [first,last), remove all but the first one. Remaining elements stay in list order.
void DataList< T, BASE >::unique | ( | BINARY_PREDICATE | p | ) | [inline] |
Remove consecutive elements satisfying a predicate.
p | Binary predicate function or object. |
For each consecutive set of elements [first,last) that satisfy predicate(first,i) where i is an iterator in [first,last), remove all but the first one. Remaining elements stay in list order.
Remove consecutive duplicate elements.
For each consecutive set of elements with the same value, remove all but the first one. Remaining elements stay in list order.
const bool DataList< T, BASE >::has_virtual = BASE::has_virtual [inline, static] |
This is true for any DataList
class if we need to use virtual derivation to get to the base DataList
class.
Reimplemented in DataList_detail::VirtBases< B1, DataModel_detail::NoBase, DataModel_detail::NoBase >, DataList_detail::VirtBases< B1, B2, DataModel_detail::NoBase >, and DataList_detail::VirtBases< B1, B2, B3 >.