CbDataList (C const &);
~CbDataList();
- bool push_back_unique(C const &);
+ /// If element is already in the list, returns false.
+ /// Otherwise, adds the element to the end of the list and returns true.
+ /// Exists to avoid double iteration of find() and push() combo.
+ bool push_back_unique(C const &element);
bool find(C const &)const;
bool findAndTune(C const &);
- /// iterates entire list to return the last element holder
+ /// Iterates the entire list to return the last element holder.
CbDataList *tail();
CbDataList *next;
C element;
return false;
}
- last->next = new CbDataList<C> (toAdd);
+ last->next = new CbDataList<C>(toAdd);
return true;
}
return last;
}
-
template <class C>
bool
CbDataList<C>::find (C const &toFind) const