31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

(b) For objects x and y of an independent item type T, the equality predicate x==y<br />

is defined individually for each such item type. In the majority of cases it<br />

means equality between the values of x and y, but this is not guaranteed for<br />

every type.<br />

Provided that the identity predicate<br />

bool identical(const T&, const T&);<br />

is defined on type T, it means equality between the values of these objects.<br />

(c) For objects x and y of a structured type the equality predicate x==y means<br />

equality between the values of these objects.<br />

4. (Illegal access via an item) It is illegal to access a container which has been destroyed<br />

via an item, or to access a container via the item nil.<br />

5. (Initialization of attributes of an independent item type) <strong>The</strong> attributes of an independent<br />

item type are always defined. In particular, a definition with default<br />

initialization initializes all attributes. Such a type may specify the initial values,<br />

but it need not.<br />

6. (Specification of the structure to be traversed in forall-macros)<br />

<strong>The</strong> argument in a forall-macro which specifies the structure to be traversed should<br />

not be a function call which returns this structure, but rather an object by itself<br />

which represents this structure.<br />

7. (Modification of objects of an item-based container type while iterating over them)<br />

An iteration over an object x of an item-based container type must not add new<br />

elements to x. It may delete the element which the iterator item points to, but no<br />

other element. <strong>The</strong> values of the elements may be modified without any restrictions.<br />

8. (Requirements for type parameters)<br />

Every type parameter T must implement the following functions:<br />

a default constructor<br />

a copy constructor<br />

an assigment operator<br />

an input operator<br />

an output operator<br />

9. (Requirements for linearly ordered types)<br />

T::T()<br />

T::T(const T&)<br />

T& T::operator = (const T&)<br />

istream& operator >> (istream&, T&)<br />

ostream& operator

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!