Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COCan you explain further the resolution you mentioned? When you say overriding on MyDerived virtual functions to select the ones I want, do you mean just "accept the fact that you have two LibBase objects, and override the methods to expose only one of them"? Unfortunately I don't think the universal wrapper would do what I would like because it would then not be compatible with the rest of the library. I'd like the each of the derived class objects to "appear" as if it's a native object of the library, but simply have a different implementation for some of the methods.
      singulars
    2. CO`virtual` in heritance is not for allowing a compiler to optimize out base classes. A `virtual` base class is for guaranteeing that there is only one base class sub-object no matter how many times that type appears as a virtual base class in the inheritance tree of a derived class object. A non-virtual base class is guaranteed to add a new base class sub-object. There's no priority and there's no option to add a second virtual base for the same type.
      singulars
    3. COCheshirekow, let me answer in back order. Aggregate exactly allows to choose between multiple implementation, you just make wrapper around impl. And MyConcrete, for example at constructor time, accepts pointer to expected implementation and exposes it by delagating each call to aggreate. "accept the fact that you have two LibBase" - unfortunately "yes" nonvirtual declaration grants you manually need override each virtual function to make decision which member of two copies must be invoked.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload