S
Simon
Hi,
if I have a structure like...
struct sMyPointers{
ClassA *m_pPointerA;
ClassB *m_pPointerB;
void *m_pPointerToSomethingElse;
};
And then
std::vector<sMyPointers *> pPointers;
sMyPointers *pA = new sMyPointers();
pPointers->push_back(pA);
pA = new sMyPointers();
pPointers->push_back(pA);
pA = new sMyPointers();
pPointers->push_back(pA);
The reason why I want pointers is mainly or speed but also to make sure that
I only have one set of data, rather than a bunch of copies all over the
place.
The data is created one and deleted once.
But is the above correct? Is it good coding practice?
regards.
Simon
if I have a structure like...
struct sMyPointers{
ClassA *m_pPointerA;
ClassB *m_pPointerB;
void *m_pPointerToSomethingElse;
};
And then
std::vector<sMyPointers *> pPointers;
sMyPointers *pA = new sMyPointers();
pPointers->push_back(pA);
pA = new sMyPointers();
pPointers->push_back(pA);
pA = new sMyPointers();
pPointers->push_back(pA);
The reason why I want pointers is mainly or speed but also to make sure that
I only have one set of data, rather than a bunch of copies all over the
place.
The data is created one and deleted once.
But is the above correct? Is it good coding practice?
regards.
Simon