Skip to content

Clean up cast operator invocations #531

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
Nov 25, 2016

Conversation

jagerman
Copy link
Member

This adds a detail::cast_op<T>(caster) inline function which allows replacement of the rather verbose and not-immediately-obvious:

    caster.operator typename CasterType::template cast_op_type<T>()

with the much shorter and clearer:

    cast_op<T>(caster)

This adds a `detail::cast_op<T>(caster)` function which handles the
rather verbose:

    caster.operator typename CasterType::template cast_op_type<T>()

which allows various places to use the shorter and clearer:

    cast_op<T>(caster)

instead of the full verbose cast operator invocation.
@wjakob
Copy link
Member

wjakob commented Nov 25, 2016

nice!

@wjakob wjakob merged commit db86f7f into pybind:master Nov 25, 2016
@jagerman
Copy link
Member Author

I think you merged it too fast: it seems to trigger an ICE under MSVC.

@aldanor
Copy link
Member

aldanor commented Nov 25, 2016

Generally better to wait for the tests to complete, yeah :)

@jagerman
Copy link
Member Author

I'll figure it out and submit a follow-up PR.

@jagerman
Copy link
Member Author

Fixed in #532. And although it's a good cleanup rather than a workaround, I still think: (insert rant about MSVC sucking here).

@wjakob
Copy link
Member

wjakob commented Nov 25, 2016

Oops, I somehow thought that they had already completed ;)

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