How do I concatenate two cocos2d::Vector s?
cocos2d::Vector<FiniteTimeAction*> V1;
cocos2d::Vector<FiniteTimeAction*> V2;
I want to have V2 appended to V1;
cocos2d::Vector has overloaded pushBack which takes a vector and pushing it back to another.
V1.pushBack(V2);
CCVector.h
/** Adds a new element at the end of the Vector. */
void pushBack(T object)
{
CCASSERT(object != nullptr, "The object should not be nullptr");
_data.push_back( object );
object->retain();
}
/** Push all elements of an existing Vector to the end of current Vector. */
void pushBack(const Vector<T>& other)
{
for(const auto &obj : other) {
_data.push_back(obj);
obj->retain();
}
}
P.S what is unclear why they do not re use pushBack(T object) in overloaded pushBack(const Vector& other)