I admit that my C ++ skills are a bit rusty and I dive right into C ++ 11 for the new project I'm about to start. I just found this confusing behavior if I write
void MyClass::update() { for(SomeClass &i : _list) { i.doStuff(); } }
or
void MyClass::update() { for(SomeClass i : _list) { i.doStuff(); } }
seems to work the exact same way, <<22> is std::list<SomeClass> . Therefore, I was interested in what is used here, since I obviously missed something. I must mention that I am using Apple LLVM 4.0, which comes with Xcode 4.4.1 (4F1003).
Please feel free to taunt and make fun of me if this is a rudely stupid question, I really could use a good patting head :)
source share