Traversing containers the smart way in C++

Traversing containers the smart way in C++

So what are Iterators? Iterators are an efficient method provided by C++ to traverse the elements of any type of containers such as: Vectors, Deques, Lists, etc. An iterator represents a certain position in a container.

A cooler way to do For-loops in C++

A cooler way to do For-loops in C++

There is a new type of for-loop in C++ 11 that you may want to give it a try. In my opinion is more clean and efficient, but you should decide yourself.

How to use Lambda functions in C++

How to use Lambda functions in C++

I have heard of Lambda functions for a while but never had the courage to use them. Well, last week I was forced to use them. They are actually not that bad to learn. I want to give you a brief overview on how to use them.

Declaring variables with "auto" in C++

Declaring variables with "auto" in C++

One of the new features in C++ 11 is the automatic type deduction: auto. With auto you can declare a variable or an object without specifying its type.

Prefer pre-increment to post-increment

Avoid wasteful overhead on user-defined types by using pre-increment rather than post-increment.