Is there a generic way (not platform dependent) to get at compile time the size of a class object in the memory, without counting the vtable pointers?
As you are asking for a portable way:
class MyClass
{
private:
struct S
{
DataMemberType1 dataMember1;
...
DataMemberTypeN dataMemberN;
} m;
public:
static const size_t MemberSize = sizeof(S);
};