Newer c++ to old c++ Code

How can I conver this to older c++ code.

1
2
3
4
 		for (BoneAnimation* boneAnimation : mBoneAnimations)
		{
			delete boneAnimation;
		}
You need to provide the type of mBoneAnimations in order to declare the iterator.
std::vector<BoneAnimation*> mBoneAnimations;
closed account (E0p9LyTq)
Reading up on vectors and the iterator member functions would be helpful.

http://www.cplusplus.com/reference/vector/vector/begin/
This is a loop, over every element of a vector, calling delete on the contents of each element.

Now that you know what it does, you can write it.
How did you you knew that it is "new C++"?

Recap on what it is:
http://antonym.org/2014/02/c-plus-plus-11-range-based-for-loops.html
http://en.cppreference.com/w/cpp/language/range-for

"old C++" had std::for_each too:
http://www.cplusplus.com/reference/algorithm/for_each/
Although, an additional functor just for deletion is more excessive than loops.
closed account (E0p9LyTq)
How can I conver[t] this to older c++ code.

Define "old C++ code," please.

The code extract you posted is a C++11 range-based for loop. The C++ standard is now officially C++17 with work being done to finalize what is expected to become C++20.

C++11 is "old code" now.

Do you want coding that is compatible with C++03? C++98? Earlier?
Topic archived. No new replies allowed.