I wouldn’t use that. While it’s a tempting feature, the syntax is incompatible with the upcoming C++0x standard, which uses:
list<Object> myList;
for (Object o : myList)
{
o.foo();
}
to do the same thing.
More Related Contents:
- Advantages of std::for_each over for loop
- Is std::string size() a O(1) operation?
- What the heque is going on with the memory overhead of std::deque?
- Do I need to protect read access to an STL container in a multithreading environment?
- How to increment an iterator by 2?
- While loop using &&
- In which scenario do I use a particular STL container?
- How do I sort a std::vector by the values of a different std::vector?
- Visual Studio support for new C / C++ standards?
- Why can’t simple initialize (with braces) 2D std::array? [duplicate]
- Why can’t we declare a std::vector?
- Determine if a type is an STL container at compile time
- std::transform() and toupper(), no matching function
- stl::multimap – how do i get groups of data?
- Does std::list::remove method call destructor of each removed element?
- Inherit interfaces which share a method name
- Should I store entire objects, or pointers to objects in containers?
- What does “#pragma comment” mean?
- What is the preferred/idiomatic way to insert into a map?
- Custom Iterator in C++
- How do you copy the contents of an array to a std::vector in C++ without looping?
- what is “stack alignment”?
- How to read and write a STL C++ string?
- What is the meaning of numeric_limits::digits10
- How does switch compile in Visual C++ and how optimized and fast is it?
- Why would I prefer using vector to deque
- Thread safety of std::map for read-only operations
- How to use _CRT_SECURE_NO_WARNINGS
- Why are the return values of these doubles -1.#IND?
- Visual Studio debugger error: Unable to start program Specified file cannot be found