If a class has no constructor/destructor, is not part of an
inheritance heirarchy, is not a template, and only contains members of
integral types, then is it okay to allocate it off the heap? Is this
bad style?
For example:
class myClass {
public:
int myInt;
}
class myClass * pMyClass;
pMyClass = new myClass();
// --OR (in Win32)--
pMyClass = (class myClass *) HeapAlloc(hProc essHeap,
HEAP_ZERO_MEMOR Y, sizeof(class myClass));
inheritance heirarchy, is not a template, and only contains members of
integral types, then is it okay to allocate it off the heap? Is this
bad style?
For example:
class myClass {
public:
int myInt;
}
class myClass * pMyClass;
pMyClass = new myClass();
// --OR (in Win32)--
pMyClass = (class myClass *) HeapAlloc(hProc essHeap,
HEAP_ZERO_MEMOR Y, sizeof(class myClass));
Comment