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.

A and B are different objects:<br />

A == B; // false<br />

(c) list L, M;<br />

list_item it1, it2;<br />

L.push(42);<br />

L.push(666);<br />

M = L;<br />

L and M now both contain the numbers 666 and 42. <strong>The</strong>se numbers are not the<br />

same objects:<br />

it1 = L.first();<br />

it2 = M.first();<br />

it1 == it2; // false<br />

L and M are different objects as well:<br />

L == M; // false<br />

In the following assignment the rules c, b, and a are applied recursivley (in this<br />

order):<br />

list< array > L, M;<br />

// ...fill L with some arrays<br />

// each of them filled with some elements...<br />

M = L;<br />

3. (a) list_item it1, it2;<br />

// ...<br />

it2 = it1; // it2 now references the same container as it1<br />

it1 == it2; // true<br />

(b) point p(2.0, 3.0);<br />

point q(2.0, 3.0);<br />

p == q; // true (as defined for class point)<br />

identical(p, q); // false<br />

point r;<br />

r = p;<br />

identical(p, r); // true<br />

(c) list L, M;<br />

// ...fill L with some elements...<br />

M = L;<br />

L == M; // false

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

Saved successfully!

Ooh no, something went wrong!