vector de vector
bonsoir,
si je cree un vector de vector d'objet
class A;
..../...
std::vector< std::vector<A> > tabA;
//remplissage
je n'ai pas a me soucier de la liberation de tabA (la class A possede bien
son destructeur)
ps: quel est la meilleur facon (ecriture) pour creer un tabA[x][y]; sachant
que A prend obligatoirement un parametre (pas de constructeur par defaut)
j'utilise
//allocation creation
std::vector < std::vector<RXSplit_point> > SplitPointStack;
for(int thread_id = 0; thread_id < MaxNumOfThreads; thread_id++) {
std::vector<RXSplit_point> tmp(MaxActiveSplitPoints);
SplitPointStack.push_back(tmp);
for(int ActiveSplitPoint_id = 0; ActiveSplitPoint_id < MaxActiveSplitPoints;
ActiveSplitPoint_id++)
SplitPointStack[thread_id].push_back( RXSplit_Point(MaxNumOfThreads) );
}
merci
--
Bruno Causse
|