C++11: Is there a standard definition for end-of-line in a multi-line string constant?

If I have a multi-line string C++11 string constant such as

Is it defined what character(s) the line terminator/separator consist of?

Context: sending a multi-line string to a server with well-defined end-of-line requirements.

The standard seems to indicate that:

is equivalent to:

From 2.14.5 String literals of the C++11 standard:

4 [ Note: A source-file new-line in a raw string literal results in a new-line in the resulting execution string literal. Assuming no whitespace at the beginning of lines in the following example, the assert will succeed:

end note ]

5 [ Example: The raw string

is equivalent to "\n)\\\na\"\n".

source: http://stackoverflow.com/

Rate this post