Feeds:
Posts
Comments

Archive for the ‘stl’ Category

Tuples

One of the containers introduced within TR1 (which is already widely available – both in gcc and Visual Studio) is a Tuple type, which is adopted from The Boost Tuple Library. Tuple types are very convenient at times; For example, it is possible to return multipe values from a function through a tuple, or write [...]

Read Full Post »

Both std::cin and std::cout provide a conversion to a void* type, but not to a boolean: operator void* (); // zero if and only if fail() What use does a conversion to a boolean have, and which pitfalls does the current implementation save us from?

Read Full Post »

Iterating over a vector is a pretty simple task we get to do pretty often. It can be achieved in quite a few ways: Using normal random access (operator[] with index). Using std::iterator. Using std::for_each algorithm. I set out to check the runtime differences between all these options, and the results turned out to be a [...]

Read Full Post »