If some class B is virtually derived from some class A
class B : public virtual A
and class B is declared for ponder like
ponder::Class::declare<B>("B")
.base<A>()
...
a runtime exception is caused. It is caused in classbuilder.inl, where the offset to apply for pointer conversions is computed. There, the value (1) is tried to be cast to the base class. In our environment, this leads at runtime to an "access violation reading location 0x00000001". Our environment: MS VS2015.
Code line where the exception occurs:
U* asBase = static_cast<U*>(asDerived);
As a side note: Actually, we do not need virtual inheritence. Hence, the above problem fortunately does not really affect us. Once we recognized the problem, we just omitted the virtual inheritence.
Currently choosing not to support virtual inheritance since it is used so infrequently. This is a tricky problem to solve and may be revisited should the need arise.
If some class B is virtually derived from some class A
and class B is declared for ponder like
a runtime exception is caused. It is caused in classbuilder.inl, where the offset to apply for pointer conversions is computed. There, the value (1) is tried to be cast to the base class. In our environment, this leads at runtime to an "access violation reading location 0x00000001". Our environment: MS VS2015. Code line where the exception occurs:
As a side note: Actually, we do not need virtual inheritence. Hence, the above problem fortunately does not really affect us. Once we recognized the problem, we just omitted the virtual inheritence.