Logo Search packages:      
Sourcecode: inkscape version File versions

Inkscape::Util::List< T > Class Template Reference

#include <list.h>

Inheritance diagram for Inkscape::Util::List< T >:

Inkscape::Util::MutableList< T > Inkscape::Util::MutableList< T >

List of all members.


Detailed Description

template<typename T>
class Inkscape::Util::List< T >

Generic linked list.

These lists are designed to store simple values like pointers, references, and scalar values. While they can be used to directly store more complex objects, destructors for those objects will not be called unless those objects derive from Inkscape::GC::Finalized.

In general it's better to use lists to store pointers or references to objects requiring finalization and manage object lifetimes separately.

See also:
Inkscape::GC::Finalized
cons() is synonymous with List<T>(first, rest), except that the compiler will usually be able to infer T from the type of rest.

If you need to create an empty list (which can, for example, be used as an 'end' value with STL algorithms), call the List<> constructor with no arguments, like so:

List<int>()

Definition at line 122 of file list.h.


Public Types

typedef Traits::Reference
< value_type >::RValue 
const_reference
typedef Traits::Reference
< value_type >::RValue 
const_reference
typedef Traits::Reference
< value_type >::Pointer 
pointer
typedef Traits::Reference
< value_type >::Pointer 
pointer
typedef Traits::Reference
< value_type >::LValue 
reference
typedef Traits::Reference
< value_type >::LValue 
reference
typedef T value_type
typedef T value_type

Public Member Functions

 List (const_reference value, List const &next=List())
 List (const_reference value, List const &next=List())
reference operator* () const
reference operator* () const
List operator++ (int)
Listoperator++ ()
List operator++ (int)
Listoperator++ ()
pointer operator-> () const
pointer operator-> () const

Friends

reference first (List const &)
 Returns the first value in a linked list.
reference first (List const &)
 Returns the first value in a linked list.
bool is_empty (List const &)
 Returns true if the given list is empty.
bool is_empty (List const &)
 Returns true if the given list is empty.
List const & rest (List const &)
 Returns the remainder of a linked list after the first element.
List const & rest (List const &)
 Returns the remainder of a linked list after the first element.

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

Generated by  Doxygen 1.6.0   Back to index