I\'m looking for practical and educational samples of C++ / STL code fitting in few lines. My actual favorites are:
Empty a vector freeing its reserved memory:<
I like this one for looping over each line in a file. From a Andrew Koenig column in Dr. Dobbs.
for (string s; getline(stream,s); ) { // Process line }