Quote:Original post by hiigara
Quote:Original post by Dizzy_exe
hash_set<Object *> (*Collisionmatrix)[Worldheight] = (hash_set<Object *> (*)[Worldheight])new hash_set<Object *> [Worldwidth * Worldheight] ;
Thanks. I think that will do the trick.
The aforementioned compilation issues aside, please don't do it that way :| Your 'Dynamic2darray' class is a much better solution.
Quote:(I don't have boost installed):
Well, you could install it - it's allowed :)
I know Boost is a big download, but multi_array is header-only, so once you've got it downloaded, all you have to do is include the multi_array header and you're good to go.
Quote:Original post by Zipster
You could also do:
vector<vector<hash_set<Object*> > > Collisionmatrix;
IMO, that seems like a step backward, even from the OP's ad hoc multidimensional array class. (I don't see any particular reason to use a jagged array for this if it can be avoided.)