search for: isoftypederived

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

2016 Jan 28
8
Proposal: virtual constant propagation
...ion of each virtual function and each virtual call is visible to the compiler, calls to either of these functions can be implemented more efficiently by loading directly from the vtable (we refer to this as virtual constant propagation): struct Base_VTable { bool isDerived : 1, isOfTypeBase : 1, isOfTypeDerived : 1; }; Base_VTable base_vtable{false, true, false}; Derived_VTable derived_vtable{true, false, true}; bool f(Base *b) { return b->vtable->isDerived; } bool g(Base *b) { return b->vtable->isOfTypeDerived; } Another advantage of implementing the calls this way is that because there...
2016 Jan 28
2
Proposal: virtual constant propagation
...s visible >> to the compiler, calls to either of these functions can be implemented more >> efficiently by loading directly from the vtable (we refer to this as virtual >> constant propagation): >> >> struct Base_VTable { >> bool isDerived : 1, isOfTypeBase : 1, isOfTypeDerived : 1; >> }; >> Base_VTable base_vtable{false, true, false}; >> Derived_VTable derived_vtable{true, false, true}; >> bool f(Base *b) { >> return b->vtable->isDerived; >> } >> bool g(Base *b) { >> return b->vtable->isOfTypeDerived; >> }...