[Lemon-devel] Quiz (good to know)

Alpár Jüttner alpar at cs.elte.hu
Wed Nov 19 12:44:49 CET 2008


Hi,

I learned something interesting and useful from Akos yesterday. Let me
share it with you (in a form of a question).

Assume we have a vector,, for example like this:

std::vector<int> v(100000);

Then what will the following expression do? What is its use?

std::vector<int>(v).swap(v);

And what about this one?

std::vector<int>().swap(v);

I offer a Turo Rudi (or some locally available equivalent) for the fist
solver.

Best regards,
Alpar




More information about the Lemon-devel mailing list