Unknown Operator

Hi everybody,

I was looking at some code and I noticed the following line:

 
for (auto ch : _params.ch)


What does the ':' operator mean in this case? I have never seen it used with the auto operator.

Thanks.
See Range-based for loop here:
http://www.cplusplus.com/doc/tutorial/control/
That is not an operator. It is range-syntax of for-loop that was introduced in C++11.
http://en.cppreference.com/w/cpp/language/range-for

Note that before C++11 the auto was a storage class specifier
http://en.cppreference.com/w/cpp/language/storage_duration

but since C++11 it does type deduction
http://en.cppreference.com/w/cpp/language/auto
Thank you to both of you!
Topic archived. No new replies allowed.