You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current adaptation for boost::any is wrong. The problem is that currently XTL still keeps the same assumption that the polymorphic implementation does: the offsets within objects of the same class must remain constant. This happens because Mach7 simply saves the offset to reapply it on other objects of the same type. With boost::any there is no such guarantee (since heap part is not at fixed offset with respect to the main boost::any object). Even with boost::variant it is possible to do heap-based implementation that would violate this, but the one in boost right now seem to satisfy the requirement.
This is not an unsolvable problem though (see bullet 4 of issue #6): we plan to have an adaptor for classes that don’t satisfy this requirement that would let users implement a slower, but type-safe cast once the subtyping relation was established with the Match statement (e.g. via the address of typeid).
The text was updated successfully, but these errors were encountered:
Current adaptation for boost::any is wrong. The problem is that currently XTL still keeps the same assumption that the polymorphic implementation does: the offsets within objects of the same class must remain constant. This happens because Mach7 simply saves the offset to reapply it on other objects of the same type. With boost::any there is no such guarantee (since heap part is not at fixed offset with respect to the main boost::any object). Even with boost::variant it is possible to do heap-based implementation that would violate this, but the one in boost right now seem to satisfy the requirement.
This is not an unsolvable problem though (see bullet 4 of issue #6): we plan to have an adaptor for classes that don’t satisfy this requirement that would let users implement a slower, but type-safe cast once the subtyping relation was established with the Match statement (e.g. via the address of typeid).
The text was updated successfully, but these errors were encountered: