Skip to content

Improve constructor resolution in variant_caster #845

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

Merged
merged 1 commit into from
May 10, 2017

Conversation

dean0x7d
Copy link
Member

Currently, py::int_(1).cast<variant<double, int>>() fills the double slot of the variant. This commit switches the loader to a 2-pass scheme in order to correctly fill the int slot.

Together with #843, this will result in correct resolution of pointers in a variant as discussed in #839.

Currently, `py::int_(1).cast<variant<double, int>>()` fills the `double`
slot of the variant. This commit switches the loader to a 2-pass scheme
in order to correctly fill the `int` slot.
@wjakob
Copy link
Member

wjakob commented May 10, 2017

Looks great!

@jagerman
Copy link
Member

That's a nice, simple fix. LGTM.

@dean0x7d dean0x7d merged commit 94d0a9f into pybind:master May 10, 2017
@dean0x7d dean0x7d deleted the variant branch May 10, 2017 21:32
@dean0x7d dean0x7d modified the milestone: v2.2 Aug 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants