How to create 2d Array use cocos2d::Vector<T> in cocos2dx3.0

I write code:
cocos2d::Vector<cocos2d::Vector<cocos2d::Object *>> object2ds;

But It error,In CCVector.h line72: Static_assert failed “Invalid Type for cocos2d::Vector!”.
My question is how to create 2d Array use cocos2d::Vector in cocos2dx3.0.
Thanks~:)

Try like this:-

cocos2d::Vector<cocos2d::Object *> object2ds;
check refrence here:- [[http://stackoverflow.com/questions/9694838/how-to-implement-2d-vector-array]]

Is this because you don’t use a space in the middle of the closing template >>? C++ will interpret those 2 characters as the stream operator.

> > is good.
>> is bad.

Hi spzktshow,

Dit you figure out how to do this?
i see the following in the constructor of verctor
static_assert(std::is_convertible<T, Ref*>::value, “Invalid Type for cocos2d::Vector!”);

Ref = cocos2d::Ref.

Since, as far as i See, but correct me if i’m wrong, the vector class does not inherit from cocos2d::Ref this assertion will always fail…

Or is there any other solution for handling 2d vectors?

helloo
this is not the way
i can’t declare 2d vector or array and can’t use it
please tell the solution how to define and access 2d vector or array in cocos2d-x c++

Do you want to create 2-dimensional array using cocos2d::Vector?
If so you can use next code:

std::vector< cocos2d::Vector<ObjectType *> > object2ds;
object2ds[4][5]