dimanche 29 août 2021

Is there a version of offsetof that applies to methods?

Given the struct:

struct Struct {
     int _a;

     int a () { return _a; }
};

One is able to get the offset of _a with offsetof( Struct, _a ).

How would I go about doing the same for something like &Struct::a?





Aucun commentaire:

Enregistrer un commentaire