-
Notifications
You must be signed in to change notification settings - Fork 19
Call an overloaded C++ function from Rust #14
Copy link
Copy link
Open
Labels
l-rustChanges that are mainly in RustChanges that are mainly in Rustp-ergonomicsProblems that make interop harder to useProblems that make interop harder to usep-semanticsLanguage semantics differencesLanguage semantics differencest-use-caseA Rust/C++ interop usage exampleA Rust/C++ interop usage example
Metadata
Metadata
Assignees
Labels
l-rustChanges that are mainly in RustChanges that are mainly in Rustp-ergonomicsProblems that make interop harder to useProblems that make interop harder to usep-semanticsLanguage semantics differencesLanguage semantics differencest-use-caseA Rust/C++ interop usage exampleA Rust/C++ interop usage example
Currently, it is very difficult to call most overloaded C++ functions from Rust, because Rust doesn't have first-class overload resolution.
This use case is supported by another project goal:
That project goal contains a FAQ including prior art and current workarounds.
Example Code
What's currently possible:
Depends On
unboxed_closures&fn_traitsfeature) rust-lang/rust#29625impl Fn for &mut F where F: Fnrust-lang/rust#148271 (maybe?)Related Work
Fn*traits on references rust-lang/rust#42736 (comment)Previous Work
User Questions
Sources