Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

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

#include <list.h>

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

List of all members.

Public Types

typedef Traits::Reference
< value_type >::RValue 
typedef Traits::Reference
< value_type >::Pointer 
typedef Traits::Reference
< value_type >::LValue 
typedef T value_type

Public Member Functions

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


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.
List const & rest (List const &)
 Returns the remainder of a linked list after the first element.

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:

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:


Definition at line 122 of file list.h.

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

Generated by  Doxygen 1.6.0   Back to index