Professional CMake:

A Practical Guide

Learn to use CMake effectively with practical advice from a CMake co-maintainer. You can also have the author work directly with your team!

Lambdas for lunch

Alright, so lambdas in C++ are cool and we’ve been coding with one arm tied behind our back all this time. C++11 brought us this wonderful goodness, which is great, but just how do you actually use them? No messing around, let’s jump right in!

Read more

Container iteration with C++11

C++11 introduced some features which make working with STL containers much easier. One common situation is the need to iterate over a container and to perform some operation(s) on each item. Consider the following typical example:

std::vector<SomeType> container;
// ...

for(std::vector<SomeType>::iterator iter = container.begin();
    iter != container.end();
    ++iter)
{
    const SomeType& item = *iter;
    // ...
}

This syntax has a couple of drawbacks:

  • It is rather verbose
  • Every aspect of the container’s type needs to be included in the definition of iter

    Read more