Whether or not it is a good idea I'm not sure. It should be possible to play similar tricks for various other types of code you might want to include as a string.
Or to include some Python code from a file test.py which is a valid Python script (because # starts a comment in Python and pass is a no-op): #define pass R"( I can have this file test.sql which is valid SQL for SQLite where - starts a comment: -x, R"(-Īnd then in my C++ code I can have: int main() If you're willing to resort to some dirty tricks you can get creative with raw string literals and #include for certain types of files.įor example, say I want to include some SQL scripts for SQLite in my project and I want to get syntax highlighting but don't want any special build infrastructure.