Zen
A cross-platform functional programming language

listbase< derT, listT, iterT, V > Class Template Reference

base of all lists More...

#include <zbl.hpp>

Inheritance diagram for listbase< derT, listT, iterT, V >:
containerbase< listT >

List of all members.

Classes

class  creator
 list creator More...
class  iterator
 list iterator More...

Public Member Functions

V & operator[] (const int &key)
 Return reference to value at index.
bool empty () const
 Check if list is empty.
void clear ()
 Empty the list.
void append (const V &v)
 Add a value to the list.
void appendList (const derT &v)
 Append a list to the list.
const V & at (const int &idx) const
 Return reference to value at index.
int indexOf (const V &v) const
 Return index of specified value in list.
V & front ()
 Return reference to value at start of list.
const V & front () const
 Return const reference to value at start of list.
V & last ()
 Return reference to value at end of list.
const V & last () const
 Return const reference to value at end of list.
derT & operator<< (const V &val)
 Add a value to the list.

Private Types

typedef containerbase< listT > baseT
 The base class type.

Detailed Description

template<typename derT, typename listT, typename iterT, typename V>
class z::listbase< derT, listT, iterT, V >

base of all lists


Member Function Documentation

void append ( const V &  v) [inline]

Add a value to the list.

Parameters:
vValue to add

Reimplemented in stringlist.

void appendList ( const derT &  v) [inline]

Append a list to the list.

Parameters:
vList to append
const V& at ( const int &  idx) const [inline]

Return reference to value at index.

Parameters:
idxThe index
Returns:
Reference to value at specified index
bool empty ( ) const [inline]

Check if list is empty.

Returns:
True if list is empty, else false.
V& front ( ) [inline]

Return reference to value at start of list.

Returns:
Reference to value at start of list
const V& front ( ) const [inline]

Return const reference to value at start of list.

Returns:
Const reference to value at start of list
int indexOf ( const V &  v) const [inline]

Return index of specified value in list.

Parameters:
vThe value
Returns:
Index of specified value
V& last ( ) [inline]

Return reference to value at end of list.

Returns:
Reference to value at end of list
const V& last ( ) const [inline]

Return const reference to value at end of list.

Returns:
Const reference to value at end of list
derT& operator<< ( const V &  val) [inline]

Add a value to the list.

Parameters:
valValue to add
Returns:
Reference to self
V& operator[] ( const int &  key) [inline]

Return reference to value at index.

Parameters:
keyThe index
Returns:
Reference to value at specified index

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines