Why is it not possible to get the length of a buffer allocated in this fashion.
AType * pArr = new AType[nVariable];
When the same array is
why not a bit of extra info like this:
template class AType { public: AType(size_t s) : data(0) { a_size = s; data = new T[s]; } ~AType() { if (data != nullptr) delete [] data; } size_t getSize() const { return a_size * sizeof(T); } private: size_t a_size; T* data; };