Okay, here's a new little topic and as I said earlier, we're going to start injecting new features from C++11 which you should start adopting into your own practice because, they're going to make your programming chores easier. There's a claim in the C++11 standard that the new version of the language is easier to use than the old version of the language. Now on the surface that may seem a little absurd. Why do I mean may seem a little absurd? Well, the new standard adds about 60% more material to the old standard. The old standard took about 800 pages to describe, the new standard takes about 1,300 pages to describe. Normally, when you have something that's another 500 pages long to describe you don't call it simpler, you call it more complicated. And indeed there are things in the new language that are fairly complicated, but there are many things in the new language such as you already saw with auto, that gives you if you adopt them, a much easier way to write code. A much more natural, more intuitive way. And here's another one of them. And that is the range based for statement. So that's our little tip of the day, our new C++11 tip of the day, which is this new for statement. How does this new for statement work? We have a declaration in the for statement. Then we have the explicit character colon. Then we have some expression. And finally, we execute a statement, and of course the statement can be a brace and closed block. So it can be, it's a single statement but of course you can make it as complicated as you want to as usual using a braced colon. Here's a simple example of its use. For double d, recognize that double d is obviously a declaration. So we've identify the variable d, that's going to be local to this range for statement, and then we have an expression. We're calling the expression, in this case, data. For example, data could be an array of doubles. And it could be an array of doubles which was declared, lets presume that it was declared as double data upper bound. So its sum of upper bounds a hundred, we have a hundred pieces of data, the data sitting in each element is a double. And you can see now what that for statement is supposed to do. It's supposed to add up all the elements in that array. And the way it adds them up, is d in turn marches. Over data. And you can think of it as d is being assigned data of i++ in turn where somehow, i was some index or cursor that was marching through that. So typically, data's gonna be an aggregate. d is gonna end up being an individual value taken from that aggregate. And you see nothing about a range. So this is even simpler than begin end. Begin end is implicit. Begin end is implicit. So this further simplifies the STL idiom of saying for an iterator auto of P equal data begin. And P not equal to data of end. And then you would do P++. So instead of that whole thing, you have a much simpler statement, and you avoid even mentioning the iteration. What can be used in the expression where you have arranged for. It can be an array, it can be an ordinary sequence. It can be a string, think about a string. A string is a series of character elements. So it's a specialized container. And conceptually, you expect them to have begin end members. So where you have sequence containers with begin end members or string or ordinary arrays. All of those are subject to the range for. Let's look at another example. That should be lower case. So here this is again a declaration the declaration is a reference declaration. Notice also that I've used auto to infer types. I'm using now several of the new ideas from C++11. So, it would have been just as suitable to have said. Double ampersand. In effect it's just a way of getting the compiler to see that that should have been double. But again you could say this is going to work regardless of type. Now rather than do summing, I'm mutating this value. And because I'm mutating it, that's why I needed the reference declaration. So again, this is a very standard idiom now with the for range and it's the standard idiom when the effort, when you're going to in your processing affect the elements that are stored in the container.