C++ 有没有像 Rust 的 include_str!
这样的宏?类似于 include!
或 include_bytes
的宏也可以满足我的要求。
最佳答案
没有标准的方法可以做到这一点。有 P1040R6 的提案 std::embed
。
如果您现在想对此进行试验,请查看 https://github.com/ThePhD/embed(由上述提案的作者提供)。你需要修补你的编译器,所以它看起来不太便携。
关于c++ - 等效于 Rust 的 include_str 的 C++ 宏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64609049/