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

Simplified parameter bindings and type projection #2775

Merged
merged 10 commits into from
Jan 7, 2024
Merged

Simplified parameter bindings and type projection #2775

merged 10 commits into from
Jan 7, 2024

Conversation

kennykerr
Copy link
Collaborator

@kennykerr kennykerr commented Jan 5, 2024

This update simplifies a few notable areas of code generation and type projection:

  • The distinction between compile- and run-time convertible parameters has been removed from the generated parameter bindings and pushed down into the type traits themselves. Practically that means that there is no longer the confusing difference between the IntoParam and TryIntoParam constraints.

  • The ComInterface and Interface traits have been combined. The distinction only matters for a small number of non-IUnknown interfaces, but the divide caused a great deal of complexity. The single Interface trait now handles both. The cast method will however panic if called from a non-IUnknown interface for obvious reasons. The branching is a compile-time decision so the unused branch should be compiled away.

  • A lot more of the boilerplate code around COM interface declarations is now hidden behind simplified macros which makes the code a lot easier to read and substantially more concise.

This also fixes #2759

@kennykerr kennykerr merged commit a4a2241 into master Jan 7, 2024
65 checks passed
@kennykerr kennykerr deleted the params2 branch January 7, 2024 14:28
astraw added a commit to astraw/iana-time-zone that referenced this pull request Feb 24, 2024
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.

Automatic conversion from WinRT class to implemented interface
2 participants