cplusplus.co.il

Archive for the ‘stl’ Category

Tuples

Posted by: rmn on: 15/01/2010

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 [...]

Both std::cin and std::cout provide a conversion to a void* type, but not to a boolean: What use does a conversion to a boolean have, and which pitfalls does the current implementation save us from?

Different ways to iterate over a vector

Posted by: rmn on: 28/08/2009

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 [...]


Follow

Get every new post delivered to your Inbox.

Join 25 other followers