It depends on your requirements, but the short answer is you cannot: the
QList<T>
is not a
POD
and, moreover, you do not have access to its implementation details. You can get an extimate of the memory usage multipling the size of each item by the size of the list, i.e.
sizeof(T) * myqlist.size()
.
[update]
Quote:
//I need a size of which NETCDF_Type i am using.
//Without sizeof();
I would write a method for that, e.g.
size_t getSize(NETCDF_Type typ);
The method implementation is up to you, in a straightforward approach, use a
switch
.
[/update]