Skip to content

Leverage AlsoUsableForAttribute for more interoperable typedefs - #930

Merged
Andrew Arnott (AArnott) merged 7 commits into
mainfrom
mikebattista/alsousablefor
May 9, 2023
Merged

Andrew Arnott (AArnott) merged 7 commits into
mainfrom
mikebattista/alsousablefor

Conversation

@mikebattista

Copy link
Copy Markdown
Contributor

Fixed #199
Fixed #924

Adds implicit conversion operators between AlsoUsableFor types. An existing example included in the tests is BCRYPT_KEY_HANDLE -> BCRYPT_HANDLE.

When microsoft/win32metadata#1517 is fixed, this will also support HMODULE <=> HINSTANCE conversions.

Generates an implicit conversion operator for each AlsoUsableFor type. Assumes the other type is in the same namespace for now. Open question how this would behave with cyclical relationships like HMODULE and HINSTANCE.

@AArnott Andrew Arnott (AArnott) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. Just a couple changes please.

@AArnott Andrew Arnott (AArnott) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks. I don't think I ever finished explaining the set of tests we have to run locally. I'll run them myself and then merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HINSTANCE is missing Leverage AlsoUsableForAttribute for more interoperable typedefs

2 participants