blocxx
Public Types | Public Member Functions | Private Types | Private Attributes | Friends | List of all members
BLOCXX_NAMESPACE::List< T > Class Template Reference

This class is a wrapper around std::list<> and adds COW capabilities. More...

#include <List.hpp>

Public Types

typedef L::value_type value_type
 
typedef L::pointer pointer
 
typedef L::const_pointer const_pointer
 
typedef L::reference reference
 
typedef L::const_reference const_reference
 
typedef L::size_type size_type
 
typedef L::difference_type difference_type
 
typedef L::iterator iterator
 
typedef L::const_iterator const_iterator
 
typedef L::reverse_iterator reverse_iterator
 
typedef L::const_reverse_iterator const_reverse_iterator
 

Public Member Functions

 List ()
 Default Constructor. More...
 
 List (L *toWrap)
 Constructor. More...
 
template<class InputIterator >
 List (InputIterator first, InputIterator last)
 Construct a List from a range specified with InputIterators. More...
 
 List (size_type n, const T &value)
 Construct a List that consist of a specified number of elements that are copies of a given object. More...
 
 List (int n, const T &value)
 Construct a List that consist of a specified number of elements that are copies of a given object. More...
 
 List (long n, const T &value)
 Construct a List that consist of a specified number of elements that are copies of a given object. More...
 
 List (size_type n)
 Construct a List that consist of a specified number of elements that have be constructed using the default constructor of class T. More...
 
LgetImpl ()
 @doctodo More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
bool empty () const
 
size_type size () const
 
size_type max_size () const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void swap (List< T > &x)
 Exchanges the elements of the current list with those of another. More...
 
iterator insert (iterator position, const T &x)
 Insert an element to the List before the element specified by the iterator. More...
 
iterator insert (iterator position)
 Insert an default-constructed element to the List before the element specified by the iterator. More...
 
template<class InputIterator >
void insert (iterator position, InputIterator first, InputIterator last)
 Insert a range of elements before a given position in the List. More...
 
void insert (iterator pos, size_type n, const T &x)
 Insert a specified number of elements that are copies of a given object before the given position in the List. More...
 
void insert (iterator pos, int n, const T &x)
 Insert a specified number of elements that are copies of a given object before the given position in the List. More...
 
void insert (iterator pos, long n, const T &x)
 Insert a specified number of elements that are copies of a given object before the given position in the List. More...
 
void push_front (const T &x)
 Prepend the specified element at the front of the List. More...
 
void push_back (const T &x)
 Append the specified element to the end of the List. More...
 
iterator erase (iterator position)
 Remove an element from the List specified with an iterator. More...
 
iterator erase (iterator first, iterator last)
 Remove elements from the List specified by a beginning and ending iterator. More...
 
void resize (size_type new_size, const T &x)
 Ensure the List has a given size. More...
 
void resize (size_type new_size)
 Ensure the List has a given size appending a default-constructed object to the end of the List if it is enlarged. More...
 
void clear ()
 Remove all items from the List. More...
 
const_iterator find (const T &x, const_iterator first, const_iterator last) const
 Find element x in the list range specified by the first and last iterators. More...
 
const_iterator find (const T &x) const
 Find element x in the list. More...
 
iterator find (const T &x, iterator first, iterator last)
 Find element x in the list range specified by the first and last iterators. More...
 
iterator find (const T &x)
 Find element x in the list. More...
 
bool contains (const T &x, const_iterator first, const_iterator last) const
 Determine if element x is contained in the list range specified by the first and last iterators. More...
 
bool contains (const T &x) const
 Determine if element x is contained in the list. More...
 
void pop_front ()
 Remove the first element in the List. More...
 
void pop_back ()
 Remove the last element in the List. More...
 
void splice (iterator position, List &x)
 @doctodo Move the specified list into the current list at the given position. More...
 
void splice (iterator position, List &x, iterator i)
 @doctodo Move the specified element from list x pointed to by iterator i into the current list at the given position. More...
 
void splice (iterator position, List &x, iterator first, iterator last)
 @doctodo Move the elements from list x specified by first and last iterators into the current list at the given position. More...
 
void remove (const T &value)
 Remove the specified element from the List. More...
 
void unique ()
 Remove all duplicate elements from the List. More...
 
void merge (List &x)
 Merge the current and specified lists, producing a combined list that is ordered with respect to the < operator. More...
 
void reverse ()
 Reverse the order of elements in the list. More...
 
void sort ()
 Sort the list using the < operator to compare elements. More...
 
template<class Predicate >
void remove_if (Predicate p)
 Removes all elements from the list for which the unary predicate p is true. More...
 
template<class BinaryPredicate >
void unique (BinaryPredicate bp)
 Remove all elements from the List for which the binary predicate bp is true. More...
 
template<class StrictWeakOrdering >
void merge (List &x, StrictWeakOrdering swo)
 Merge the current and specified list, producing a combined list that is ordered with respect to the specified comparisation class. More...
 
template<class StrictWeakOrdering >
void sort (StrictWeakOrdering swo)
 Sort the list using the specified comparisation class. More...
 

Private Types

typedef std::list< T > L
 

Private Attributes

COWReference< Lm_impl
 

Friends

bool operator== (const List< T > &x, const List< T > &y)
 Determine equality of two Lists comparing the size of both lists and all elements in the same position using the elements "==" operator. More...
 
bool operator< (const List< T > &x, const List< T > &y)
 Determine if one Lists is less than another comparing the size of both lists and all their elements. More...
 

Detailed Description

template<class T>
class BLOCXX_NAMESPACE::List< T >

This class is a wrapper around std::list<> and adds COW capabilities.

Definition at line 77 of file List.hpp.

Member Typedef Documentation

◆ const_iterator

template<class T >
typedef L::const_iterator BLOCXX_NAMESPACE::List< T >::const_iterator

Definition at line 103 of file List.hpp.

◆ const_pointer

template<class T >
typedef L::const_pointer BLOCXX_NAMESPACE::List< T >::const_pointer

Definition at line 97 of file List.hpp.

◆ const_reference

template<class T >
typedef L::const_reference BLOCXX_NAMESPACE::List< T >::const_reference

Definition at line 99 of file List.hpp.

◆ const_reverse_iterator

template<class T >
typedef L::const_reverse_iterator BLOCXX_NAMESPACE::List< T >::const_reverse_iterator

Definition at line 105 of file List.hpp.

◆ difference_type

template<class T >
typedef L::difference_type BLOCXX_NAMESPACE::List< T >::difference_type

Definition at line 101 of file List.hpp.

◆ iterator

template<class T >
typedef L::iterator BLOCXX_NAMESPACE::List< T >::iterator

Definition at line 102 of file List.hpp.

◆ L

template<class T >
typedef std::list<T> BLOCXX_NAMESPACE::List< T >::L
private

Definition at line 92 of file List.hpp.

◆ pointer

template<class T >
typedef L::pointer BLOCXX_NAMESPACE::List< T >::pointer

Definition at line 96 of file List.hpp.

◆ reference

template<class T >
typedef L::reference BLOCXX_NAMESPACE::List< T >::reference

Definition at line 98 of file List.hpp.

◆ reverse_iterator

template<class T >
typedef L::reverse_iterator BLOCXX_NAMESPACE::List< T >::reverse_iterator

Definition at line 104 of file List.hpp.

◆ size_type

template<class T >
typedef L::size_type BLOCXX_NAMESPACE::List< T >::size_type

Definition at line 100 of file List.hpp.

◆ value_type

template<class T >
typedef L::value_type BLOCXX_NAMESPACE::List< T >::value_type

Definition at line 95 of file List.hpp.

Constructor & Destructor Documentation

◆ List() [1/7]

template<class T >
BLOCXX_NAMESPACE::List< T >::List ( )
inline

Default Constructor.

Definition at line 110 of file List.hpp.

◆ List() [2/7]

template<class T >
BLOCXX_NAMESPACE::List< T >::List ( L toWrap)
inlineexplicit

Constructor.

Parameters
toWrapThe std::list to wrap with this List object.

Definition at line 115 of file List.hpp.

◆ List() [3/7]

template<class T >
template<class InputIterator >
BLOCXX_NAMESPACE::List< T >::List ( InputIterator  first,
InputIterator  last 
)
inline

Construct a List from a range specified with InputIterators.

Parameters
firstThe iterator for the beginning of the range.
lastThe iterator for the end of the range.

Definition at line 124 of file List.hpp.

◆ List() [4/7]

template<class T >
BLOCXX_NAMESPACE::List< T >::List ( size_type  n,
const T &  value 
)
inline

Construct a List that consist of a specified number of elements that are copies of a given object.

Parameters
nNumber of elements the List will contain.
valueThe value every element of the List will be initialized to.

Definition at line 135 of file List.hpp.

◆ List() [5/7]

template<class T >
BLOCXX_NAMESPACE::List< T >::List ( int  n,
const T &  value 
)
inline

Construct a List that consist of a specified number of elements that are copies of a given object.

Parameters
nNumber of elements the List will contain.
valueThe value every element of the List will be initialized to.

Definition at line 145 of file List.hpp.

◆ List() [6/7]

template<class T >
BLOCXX_NAMESPACE::List< T >::List ( long  n,
const T &  value 
)
inline

Construct a List that consist of a specified number of elements that are copies of a given object.

Parameters
nNumber of elements the List will contain.
valueThe value every element of the List will be initialized to.

Definition at line 155 of file List.hpp.

◆ List() [7/7]

template<class T >
BLOCXX_NAMESPACE::List< T >::List ( size_type  n)
inlineexplicit

Construct a List that consist of a specified number of elements that have be constructed using the default constructor of class T.

Parameters
nNumber of elements the List will contain.

Definition at line 163 of file List.hpp.

Member Function Documentation

◆ back() [1/2]

template<class T >
reference BLOCXX_NAMESPACE::List< T >::back ( )
inline
Returns
A read/write reference to the last element in the List.

Definition at line 284 of file List.hpp.

◆ back() [2/2]

template<class T >
const_reference BLOCXX_NAMESPACE::List< T >::back ( ) const
inline
Returns
A read only reference to the last element in the List.

Definition at line 291 of file List.hpp.

◆ begin() [1/2]

template<class T >
iterator BLOCXX_NAMESPACE::List< T >::begin ( )
inline
Returns
A read/write iterator that points to the first element in the List. Iteration is done in the normal order (1st to last) with the returned iterator.

Definition at line 179 of file List.hpp.

◆ begin() [2/2]

template<class T >
const_iterator BLOCXX_NAMESPACE::List< T >::begin ( ) const
inline
Returns
A read only iterator that points to the first element in the List. Iteration is done in the normal order (1st to last) with the returned iterator.

Definition at line 188 of file List.hpp.

◆ clear()

template<class T >
void BLOCXX_NAMESPACE::List< T >::clear ( )
inline

Remove all items from the List.

The size() of the List should be zero after calling this method.

Definition at line 443 of file List.hpp.

◆ contains() [1/2]

template<class T >
bool BLOCXX_NAMESPACE::List< T >::contains ( const T &  x) const
inline

Determine if element x is contained in the list.

Parameters
xThe element to seach for.
Returns
true if the element x is contained in the list.

Definition at line 527 of file List.hpp.

◆ contains() [2/2]

template<class T >
bool BLOCXX_NAMESPACE::List< T >::contains ( const T &  x,
const_iterator  first,
const_iterator  last 
) const
inline

Determine if element x is contained in the list range specified by the first and last iterators.

Parameters
xThe element to seach for.
firstThe first position iterator; begin of the range.
lastThe last position iterator; end of the range.
Returns
true if the element x is contained in the specified range of the list.

Definition at line 517 of file List.hpp.

◆ empty()

template<class T >
bool BLOCXX_NAMESPACE::List< T >::empty ( ) const
inline
Returns
true if the List is empty (contains zero elements)

Definition at line 249 of file List.hpp.

References BLOCXX_NAMESPACE::List< T >::m_impl.

◆ end() [1/2]

template<class T >
iterator BLOCXX_NAMESPACE::List< T >::end ( )
inline
Returns
A read/write iterator that points to one past the last element in the List. Iteration is done in the normal order (1st to last) with the returned iterator.

Definition at line 197 of file List.hpp.

◆ end() [2/2]

template<class T >
const_iterator BLOCXX_NAMESPACE::List< T >::end ( ) const
inline
Returns
A read only iterator that points to one past the last element in the List. Iteration is done in the normal order (1st to last) with the returned iterator.

Definition at line 206 of file List.hpp.

◆ erase() [1/2]

template<class T >
iterator BLOCXX_NAMESPACE::List< T >::erase ( iterator  first,
iterator  last 
)
inline

Remove elements from the List specified by a beginning and ending iterator.

Parameters
firstAn iterator that specifies the first element to remove.
lastAn iterator that specifies the last element to remove.
Returns
An iterator that points to the element that was following the last removed element in the List.

Definition at line 415 of file List.hpp.

References BLOCXX_NAMESPACE::List< T >::m_impl.

◆ erase() [2/2]

template<class T >
iterator BLOCXX_NAMESPACE::List< T >::erase ( iterator  position)
inline

Remove an element from the List specified with an iterator.

Parameters
positionAn iterator that points to the element to be removed.
Returns
An iterator that points to the element that was following the removed element in the List.

Definition at line 402 of file List.hpp.

◆ find() [1/4]

template<class T >
iterator BLOCXX_NAMESPACE::List< T >::find ( const T &  x)
inline

Find element x in the list.

Parameters
xThe element to seach for.
Returns
An read/write iterator pointing to the found element or the end iterator pointing one past the last element in the list.

Definition at line 504 of file List.hpp.

◆ find() [2/4]

template<class T >
const_iterator BLOCXX_NAMESPACE::List< T >::find ( const T &  x) const
inline

Find element x in the list.

Parameters
xThe element to seach for.
Returns
An read only iterator pointing to the found element or the end iterator pointing one past the last element in the list.

Definition at line 474 of file List.hpp.

◆ find() [3/4]

template<class T >
const_iterator BLOCXX_NAMESPACE::List< T >::find ( const T &  x,
const_iterator  first,
const_iterator  last 
) const
inline

Find element x in the list range specified by the first and last iterators.

Parameters
xThe element to seach for.
firstThe first position iterator; begin of the range.
lastThe last position iterator; end of the range.
Returns
An read only iterator pointing to the found element or the end iterator pointing one past the last element in the list.

Definition at line 456 of file List.hpp.

◆ find() [4/4]

template<class T >
iterator BLOCXX_NAMESPACE::List< T >::find ( const T &  x,
iterator  first,
iterator  last 
)
inline

Find element x in the list range specified by the first and last iterators.

Parameters
xThe element to seach for.
firstThe first position iterator; begin of the range.
lastThe last position iterator; end of the range.
Returns
An read/write iterator pointing to the found element or the end iterator pointing one past the last element in the list.

Definition at line 487 of file List.hpp.

◆ front() [1/2]

template<class T >
reference BLOCXX_NAMESPACE::List< T >::front ( )
inline
Returns
A read/write reference to the first element in the List.

Definition at line 270 of file List.hpp.

References BLOCXX_NAMESPACE::List< T >::m_impl, and BLOCXX_NAMESPACE::COWReference< T >::swap().

◆ front() [2/2]

template<class T >
const_reference BLOCXX_NAMESPACE::List< T >::front ( ) const
inline
Returns
A read only reference to the first element in the List.

Definition at line 277 of file List.hpp.

◆ getImpl()

template<class T >
L* BLOCXX_NAMESPACE::List< T >::getImpl ( )
inline

@doctodo

Returns
Pointer to the std::list object used to implement the List class.

Definition at line 170 of file List.hpp.

◆ insert() [1/6]

template<class T >
void BLOCXX_NAMESPACE::List< T >::insert ( iterator  pos,
int  n,
const T &  x 
)
inline

Insert a specified number of elements that are copies of a given object before the given position in the List.

Parameters
posThe position to insert the elements before.
nNumber of elements to insert.
xThe value every newly inserted element of the List will be initialized to.

Definition at line 360 of file List.hpp.

◆ insert() [2/6]

template<class T >
void BLOCXX_NAMESPACE::List< T >::insert ( iterator  pos,
long  n,
const T &  x 
)
inline

Insert a specified number of elements that are copies of a given object before the given position in the List.

Parameters
posThe position to insert the elements before.
nNumber of elements to insert.
xThe value every newly inserted element of the List will be initialized to.

Definition at line 373 of file List.hpp.

References BLOCXX_NAMESPACE::List< T >::m_impl.

◆ insert() [3/6]

template<class T >
void BLOCXX_NAMESPACE::List< T >::insert ( iterator  pos,
size_type  n,
const T &  x 
)
inline

Insert a specified number of elements that are copies of a given object before the given position in the List.

Parameters
posThe position to insert the elements before.
nNumber of elements to insert.
xThe value every newly inserted element of the List will be initialized to.

Definition at line 347 of file List.hpp.

◆ insert() [4/6]

template<class T >
iterator BLOCXX_NAMESPACE::List< T >::insert ( iterator  position)
inline

Insert an default-constructed element to the List before the element specified by the iterator.

Parameters
positionAn iterator that points to the insertion point. The element will be inserted before this point.
Returns
An iterator that points to the newly inserted element.

Definition at line 322 of file List.hpp.

◆ insert() [5/6]

template<class T >
iterator BLOCXX_NAMESPACE::List< T >::insert ( iterator  position,
const T &  x 
)
inline

Insert an element to the List before the element specified by the iterator.

Parameters
positionAn iterator that points to the insertion point. The element will be inserted before this point.
xThe element to insert into the List.
Returns
An iterator that points to the newly inserted element.

Definition at line 311 of file List.hpp.

◆ insert() [6/6]

template<class T >
template<class InputIterator >
void BLOCXX_NAMESPACE::List< T >::insert ( iterator  position,
InputIterator  first,
InputIterator  last 
)
inline

Insert a range of elements before a given position in the List.

Parameters
positionThe position to insert the elements at. The insertion will be done before this position.
firstThe beginning of the range of elements to insert.
lastThe end of the range of elements to insert.

Definition at line 334 of file List.hpp.

◆ max_size()

template<class T >
size_type BLOCXX_NAMESPACE::List< T >::max_size ( ) const
inline
Returns
The maximal number of elements the List can hold.

Definition at line 263 of file List.hpp.

References BLOCXX_NAMESPACE::List< T >::m_impl.

◆ merge() [1/2]

template<class T >
void BLOCXX_NAMESPACE::List< T >::merge ( List< T > &  x)
inline

Merge the current and specified lists, producing a combined list that is ordered with respect to the < operator.

Parameters
xThe list to merge with.

Definition at line 600 of file List.hpp.

◆ merge() [2/2]

template<class T >
template<class StrictWeakOrdering >
void BLOCXX_NAMESPACE::List< T >::merge ( List< T > &  x,
StrictWeakOrdering  swo 
)
inline

Merge the current and specified list, producing a combined list that is ordered with respect to the specified comparisation class.

Parameters
swoThe comparisation functor class.

Definition at line 641 of file List.hpp.

◆ pop_back()

template<class T >
void BLOCXX_NAMESPACE::List< T >::pop_back ( )
inline

Remove the last element in the List.

Definition at line 541 of file List.hpp.

◆ pop_front()

template<class T >
void BLOCXX_NAMESPACE::List< T >::pop_front ( )
inline

Remove the first element in the List.

Definition at line 534 of file List.hpp.

References i, and BLOCXX_NAMESPACE::List< T >::m_impl.

◆ push_back()

template<class T >
void BLOCXX_NAMESPACE::List< T >::push_back ( const T &  x)
inline

Append the specified element to the end of the List.

Parameters
xThe element to append to the end of the List.

Definition at line 391 of file List.hpp.

◆ push_front()

template<class T >
void BLOCXX_NAMESPACE::List< T >::push_front ( const T &  x)
inline

Prepend the specified element at the front of the List.

Parameters
xThe element to prepend to the front of the List.

Definition at line 382 of file List.hpp.

◆ rbegin() [1/2]

template<class T >
reverse_iterator BLOCXX_NAMESPACE::List< T >::rbegin ( )
inline
Returns
A read/write reverse iterator that points to the last element in the List. Iteration is done in the reverse order (last to 1st) with the returned iterator.

Definition at line 215 of file List.hpp.

◆ rbegin() [2/2]

template<class T >
const_reverse_iterator BLOCXX_NAMESPACE::List< T >::rbegin ( ) const
inline
Returns
A read only reverse iterator that points to the last element in the List. Iteration is done in the reverse order (last to 1st) with the returned iterator.

Definition at line 224 of file List.hpp.

◆ remove()

template<class T >
void BLOCXX_NAMESPACE::List< T >::remove ( const T &  value)
inline

Remove the specified element from the List.

Parameters
valueThe element to remove.

Definition at line 584 of file List.hpp.

◆ remove_if()

template<class T >
template<class Predicate >
void BLOCXX_NAMESPACE::List< T >::remove_if ( Predicate  p)
inline

Removes all elements from the list for which the unary predicate p is true.

Parameters
pThe unary predicate

Definition at line 623 of file List.hpp.

◆ rend() [1/2]

template<class T >
reverse_iterator BLOCXX_NAMESPACE::List< T >::rend ( )
inline
Returns
A read/write reverse iterator that points to one before the first element in the List. Iteration is done in the reverse order (last to 1st) with the returned iterator.

Definition at line 233 of file List.hpp.

◆ rend() [2/2]

template<class T >
const_reverse_iterator BLOCXX_NAMESPACE::List< T >::rend ( ) const
inline
Returns
A read only reverse iterator that points to one before the first element in the List. Iteration is done in the reverse order (last to 1st) with the returned iterator.

Definition at line 242 of file List.hpp.

References BLOCXX_NAMESPACE::List< T >::m_impl.

◆ resize() [1/2]

template<class T >
void BLOCXX_NAMESPACE::List< T >::resize ( size_type  new_size)
inline

Ensure the List has a given size appending a default-constructed object to the end of the List if it is enlarged.

Parameters
new_sizeThe new size of the List.

Definition at line 435 of file List.hpp.

◆ resize() [2/2]

template<class T >
void BLOCXX_NAMESPACE::List< T >::resize ( size_type  new_size,
const T &  x 
)
inline

Ensure the List has a given size.

Parameters
new_sizeThe new size of the List.
xAn object to append to the end of the List if it is enlarged.

Definition at line 425 of file List.hpp.

◆ reverse()

template<class T >
void BLOCXX_NAMESPACE::List< T >::reverse ( )
inline

Reverse the order of elements in the list.

Definition at line 607 of file List.hpp.

◆ size()

template<class T >
size_type BLOCXX_NAMESPACE::List< T >::size ( ) const
inline
Returns
The number of elements in the List.

Definition at line 256 of file List.hpp.

References BLOCXX_NAMESPACE::List< T >::m_impl.

◆ sort() [1/2]

template<class T >
void BLOCXX_NAMESPACE::List< T >::sort ( )
inline

Sort the list using the < operator to compare elements.

Definition at line 614 of file List.hpp.

◆ sort() [2/2]

template<class T >
template<class StrictWeakOrdering >
void BLOCXX_NAMESPACE::List< T >::sort ( StrictWeakOrdering  swo)
inline

Sort the list using the specified comparisation class.

Parameters
swoThe comparisation functor class.

Definition at line 649 of file List.hpp.

◆ splice() [1/3]

template<class T >
void BLOCXX_NAMESPACE::List< T >::splice ( iterator  position,
List< T > &  x 
)
inline

@doctodo Move the specified list into the current list at the given position.

Parameters
positionThe iterator pointing to the insert position.
xThe list to move elements from.

Definition at line 551 of file List.hpp.

◆ splice() [2/3]

template<class T >
void BLOCXX_NAMESPACE::List< T >::splice ( iterator  position,
List< T > &  x,
iterator  first,
iterator  last 
)
inline

@doctodo Move the elements from list x specified by first and last iterators into the current list at the given position.

Parameters
positionThe iterator pointing to the insert position.
xThe list to insert element from.
firstThe first element in List x to move.
lastThe last element in List x to move.

Definition at line 576 of file List.hpp.

◆ splice() [3/3]

template<class T >
void BLOCXX_NAMESPACE::List< T >::splice ( iterator  position,
List< T > &  x,
iterator  i 
)
inline

@doctodo Move the specified element from list x pointed to by iterator i into the current list at the given position.

Parameters
positionThe iterator pointing to the insert position.
xThe List to insert element from.
iThe element in List x to move.

Definition at line 563 of file List.hpp.

References BLOCXX_NAMESPACE::List< T >::m_impl.

◆ swap()

template<class T >
void BLOCXX_NAMESPACE::List< T >::swap ( List< T > &  x)
inline

Exchanges the elements of the current list with those of another.

Parameters
xThe another List, this List will exchange its elements with.

Definition at line 299 of file List.hpp.

◆ unique() [1/2]

template<class T >
void BLOCXX_NAMESPACE::List< T >::unique ( )
inline

Remove all duplicate elements from the List.

Definition at line 591 of file List.hpp.

◆ unique() [2/2]

template<class T >
template<class BinaryPredicate >
void BLOCXX_NAMESPACE::List< T >::unique ( BinaryPredicate  bp)
inline

Remove all elements from the List for which the binary predicate bp is true.

Parameters
bpThe binary predicate

Definition at line 632 of file List.hpp.

Friends And Related Function Documentation

◆ operator<

template<class T >
bool operator< ( const List< T > &  x,
const List< T > &  y 
)
friend

Determine if one Lists is less than another comparing the size of both lists and all their elements.

Parameters
xThe first List in the comparison.
xThe second List in the comparison.
Returns
true if the List x is less than List y.

Definition at line 677 of file List.hpp.

◆ operator==

template<class T >
bool operator== ( const List< T > &  x,
const List< T > &  y 
)
friend

Determine equality of two Lists comparing the size of both lists and all elements in the same position using the elements "==" operator.

Parameters
xThe first List in the comparison.
xThe second List in the comparison.
Returns
true if the Lists are equal.

Definition at line 672 of file List.hpp.

Member Data Documentation

◆ m_impl

template<class T >
COWReference<L> BLOCXX_NAMESPACE::List< T >::m_impl
private

The documentation for this class was generated from the following file: