rust-cpp
rust-cpp copied to clipboard
Using elements defined in `cpp!` macro in other cpp files
From the example provided, I know that you can include other libraries in the C++ blocks:
cpp!{{
#include <iostream>
}}
I'm wondering if it is possible to use things defined in cpp!
macros in other C++ files. For example, one can define a function in the block like this:
cpp!{{
#include <iostream>
int cpp_func(){
return 42;
}
}}
Are there any ways for other cpp files to use the function cpp_func
?
If this is possible, then I believe this project can also be used to embed Rust code in C++, as one can wrap all the C++ code by cpp!
and insert Rust by rust!
.
Also, is it possible to open a discussion page for this project? I believe it is more suitable to place questions like this on the discussion page.