Friday, December 3, 2010

Class Size

class FA {int f() {return 1;}}; is 1 byte on Solaris.

Non-virtual Functions do not add any size to a class/struct, so from a size point of view, this is an empty structure, which just requires the one byte for reference.

No comments:

Post a Comment