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

Template CxPlatAsync #51

Merged
merged 4 commits into from
Jul 20, 2024
Merged

Template CxPlatAsync #51

merged 4 commits into from
Jul 20, 2024

Conversation

nibanks
Copy link
Member

@nibanks nibanks commented Jul 20, 2024

Updates CxPlatAsync interface so that the input type is templated and removes the return type so that callers can remove all the extra casting as well as we provide compile-time type safety. The downside is that you must explicitly specify the template types (though you can always define your own typedef). Example usages (from test code):

CxPlatAsync Async([](void*) -> void {
    // no-op
});
uint32_t Ctx = 0;
CxPlatAsyncT<uint32_t> Async([](uint32_t* Ctx) -> void {
    *Ctx = 123;
}, &Ctx);

@nibanks nibanks added the enhancement New feature or request label Jul 20, 2024
@nibanks nibanks enabled auto-merge (squash) July 20, 2024 16:32
@nibanks nibanks merged commit 6d1ab31 into main Jul 20, 2024
74 checks passed
@nibanks nibanks deleted the template-cxplatasync branch July 20, 2024 16:34
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.

2 participants