Re: How to find a STL class size?
On Oct 31, 7:26 pm, "webinfin...@gmail.com" <webinfin...@gmail.com>
wrote:
How to find a STL class size, for example: string. I would like to
know what the size of the implementation of this class, I am not
interested in the size of its object but the class itself. There are
discussion regarding addition of all the data member of the class/
structure to find out its size, but is there a neat way to find out
class' size?
I'm afraid I don't understand the question: formally, only
objects have size, not classes. So do you want to know:
-- the actual size of the object: sizeof will give you that,
-- the total memory used by the object: this will depend
enormously on the implementation, and will probably vary
from one object to the next, or
-- the memory used by the class, independently of any
instances---this is also very, very implementation
dependent, and may also depend on which functions you use in
the class.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34