My Octopress Blog

A blogging framework for hackers.

Vector

Had a bizarre C.S. / kitten related dream. Apparently I was giving way kittens, and I wanted to make sure I had one left for myself, and so I thought it would be a good idea to declare a standard template library vector of kittens, fill it with my kittens, and only give away more kittens while there was still more than one left:

vector kitties;

# Put kittens in vector
# ...

while(kitties.length() > 1) {
	give_away(kitties.pop());
}