Skip to content

fix: make robust c++ type deduce#19

Closed
devillove084 wants to merge 1 commit intopcwalton:mainfrom
devillove084:fix/remove_trait_promise
Closed

fix: make robust c++ type deduce#19
devillove084 wants to merge 1 commit intopcwalton:mainfrom
devillove084:fix/remove_trait_promise

Conversation

@devillove084
Copy link
Contributor

Completely remove template specialization code: Modern C++ compilers (supporting C++20 coroutines) can automatically infer promise_type. Rely on automatic lookup mechanism: As long as the RustPromise class defines the correct coroutine interface, the compiler can find it.

FIX: Avoid problems with complex macro generation and template specialization

Why does this solution work?

  • C++20 coroutines will automatically look for the promise_type of the return type
  • The RustPromise class has implemented all interfaces required for coroutine promises
  • Avoid error-prone template specialization and macro generation
  • Fully compliant with the C++20 coroutine specification

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.

1 participant