Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of boost::any is currently incorrect #17

Open
solodon4 opened this issue Jan 12, 2015 · 1 comment
Open

Support of boost::any is currently incorrect #17

solodon4 opened this issue Jan 12, 2015 · 1 comment
Assignees
Labels

Comments

@solodon4
Copy link
Owner

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).

@elfprince13
Copy link
Contributor

Checking in on this front as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants