ark 211195

Prev: johnson 150695 Up: Usenet

Newsgroups: comp.lang.c++
From: [email protected] (Note:
 Andrew Koenig.)
Subject: Re: [Q] virtual function space overhead
Date: Tue, 21 Nov 1995 03:59:07 GMT

> can i reasonably expect that the increase in the size of an object due to
> it's virtual functions is appoximately (size of pointer)*(number virts)?

No, it's much better than that.  In every implementation I've seen,
the size of an object due to virtual functions increases by
(size of pointer)*(1+max(0,(number of base classes)-1)), more or less.
There is an additional overhead of (size of pointer)*(number of virts),
but it's per type, not per object.

automatically generated by info2www version 1.2.2.8