I am tempted to use less-than-pleasant words as a response, but I think
I will abstain. Instead, I will present an actual real-life situation where
such a thing is useful.
When programming with something that uses OpenGL, and thus GLSL for shaders,
the shaders are their own programming language inside strings. You could have
these GLSL sources in separate files, or you could have them as string literals
inside your program. The advantage of having them as string literals is that
you don't need to include extraneous files in your project (which may even be
easily modified by somebody), and you can build your strings from parts.
If there's some common GLSL code that could be useful in several shaders, you
can create string literales by concatenating separate ones. One easy way to do
that is to use macros for the string literals containing common code.
So you could have something like:
#define GLSL_COMMON_FUNC R"#(
float func(float) {
... whatever ...
}
)#"
After which you can create a shader using that function like
const char* const myShader = GLSL_COMMON_FUNC
"void main() { etc etc }"
Sure, you could just add the \ symbols at the end of each line in the macro,
but why bother, if you don't have to?