For example, for copy/paste purposes, it is very convenient to write :
C#
@"
SELECT * FROM ......
WHERE X = (SELECT Y FROM .....)
AND M IN ('1','2','3')
";
or
Python:
"""
SELECT * FROM ......
WHERE X = (SELECT Y FROM .....)
AND M IN ('1','2','3')
"""
than:
C++
"SELECT * FROM ...... \
WHERE X = (SELECT Y FROM .....) \
AND M IN ('1','2','3')"
Is there any way to avoid the \ style in C++ and approach to C# or python style?
Thanks.
I think C++11 allows newlines in raw string literals, e.g.:
Each newline in the source should result in a newline in the execution string-literal. Raw string literals generally take the form of
R"( ... )". For GCC this requires at least version 4.5, and for clang++, it requires version 3.0. Alternatively, you can use a custom delimiter to make it easier to disambiguate the end of the string: