Auto Type Deduction in Range-Based For Loops--Petr Zemek

Which one to use?

Auto Type Deduction in Range-Based For Loops

by Petr Zemek

From the article:

Have you ever wondered which of the following variants you should use in range-based for loops and when? auto, const auto, auto&, const auto&, auto&&, const auto&&, or decltype(auto)? This post tries to present rules of thumb that you can use in day-to-day coding. As you will see, only four of these variants are generally useful.

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.