search for: define_subclass_data

Displaying 2 results from an estimated 2 matches for "define_subclass_data".

2019 Dec 24
2
RFC: Refactor SubclassData
...ne of those offsets/sizes in a base class, then all the classes derived, will have to be adjusted accordingly - which can be very tedious and error-prone. I offer a small set of macros which will take care of the whole Subclass-Data. It will work as follows: struct A { int SubclassData : 14; DEFINE_SUBCLASS_DATA() }; struct B : A { BEGIN_SUBCLASS_DATA() ADD_SUBCLASS_BITFIELD(int, 5, B1) // A::SubclassData bits [0,5) ADD_SUBCLASS_BITFIELD(bool, 1, B2) // A::SubclassData bits [5,6) ADD_SUBCLASS_BITFIELD(short, 6, B3) // A::SubclassData bits [6,12) // ADD_SUBCLASS_BITFIELD(int, 6, B4) // A::Subcl...
2019 Dec 26
2
RFC: Refactor SubclassData
...e adjusted accordingly - >> which can be very tedious and error-prone. >> >> I offer a small set of macros which will take care of the whole >> Subclass-Data. >> It will work as follows: >> >> struct A { >> int SubclassData : 14; >> >> DEFINE_SUBCLASS_DATA() >> }; >> >> struct B : A { >> BEGIN_SUBCLASS_DATA() >> ADD_SUBCLASS_BITFIELD(int, 5, B1) // A::SubclassData bits [0,5) >> ADD_SUBCLASS_BITFIELD(bool, 1, B2) // A::SubclassData bits [5,6) >> ADD_SUBCLASS_BITFIELD(short, 6, B3) // A::SubclassData b...