swap


Description:

[ CCode ( cname = "g_sequence_swap" ) ]
public void swap (SequenceIter<G> dest)

Swaps the items pointed to by a and b.

It is allowed for a and b to point into difference sequences.

Example: Swap:

public static int main (string[] args) {
Sequence<string> seq = new Sequence<string> ();
seq.append ("Lorem");
seq.append ("ipsum");
seq.append ("dolor");
seq.append ("amet");
seq.append ("sit");

SequenceIter<string> iter1 = seq.get_iter_at_pos (3);
SequenceIter<string> iter2 = seq.get_iter_at_pos (4);
iter1.swap (iter2);

// Output:
// ``Lorem`` (Lorem)
// ``ipsum`` (ipsum)
// ``dolor`` (dolor)
// ``sit`` (amet)
// ``amet`` (sit)
seq.foreach ((item) => {
print ("%s\n", item);
});

return 0;
}

valac --pkg glib-2.0 GLib.SequenceIter.swap.vala

Parameters:

a

a SequenceIter

b

a SequenceIter