< value_type >::RValue
< value_type >::Pointer
< value_type >::LValue
|List (const_reference value, List const &next=List())|
|reference||operator* () const|
|List &||operator++ ()|
|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. |
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.
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: