Equivalent C++ macro to Rust's include_str

Viewed 483

Does C++ have a macro like Rust's include_str!? Macros similar to include! or include_bytes would also meet my requirements.

1 Answers

There's no standard way to do this. There's proposal P1040R6 for std::embed.

If you want to experiment with this right now, check out https://github.com/ThePhD/embed (which is by the author of the aforementioned proposal). You'll need to patch your compiler though, so it doesn't seem very portable.

Related