rust-cpp
rust-cpp copied to clipboard
Embed C++ directly inside your rust code!
I have some code, which uses the `cpp!` Macro. Trying to compile it, I get the following error messages during the linking: https://pastebin.com/gC65PeZy Just running `cargo check' does not show...
Is there a way to use cpp! in integration tests? Currently, in the build script, we pass project root. However, integration tests don't get included in the library root and...
Using the cpp_class! macro with a simple class aborts on freeing the resource. This is happening on Ubuntu 1804. Code snippet reproducing the issue: ``` use cpp::cpp; use cpp::cpp_class; cpp!{{...
It's still using the old derive marco hack. Having a real proc macro will also make the rust! better as we won't need an unique name in there, and we...
If the C++ code captured throws an exception, it might be nice to have an option for rust-cpp to add an exception handler which translates the exception into a rust...
In the generated cpp_closures.cpp, every chunk of code copied verbatim from `cpp!([]{})` content is preceded by `#line` pragma and a line with an inconsistently large amount of spaces. Which probably...
## Summary I want to evaluate C++ code at compile time, and use produced values in const-expr contexts Rust which is a more strict requirement than just any rvalue. ```rust...
## Summary As a user of `cpp!()` library, for whatever reason, I may want to write this: ```rust cpp!(unsafe [n as "int"] { rust!(#[allow(unused)] Rust_myCallback [n : i32 as "int"]...
``` cpp!{{ #include #include }} fn as_cstr_ptr(str: &str) -> Result { let c_string: *const u8 = CString::new(str)?.as_bytes_with_nul().as_ptr(); Ok(c_string) } pub fn set_env_variable(name: &str, value: &str, overwrite: i32) -> Result {...
The readme says that it is not possible to embed the `cpp!` macro in other macros. What is needed to make this possible?