C++: 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 R"""line 1 line 2 line3""" Is it defined what character(s) the line terminator/separator consist of? 回答1: The intent is that a newline in a raw string literal maps to a single '\n' character. This intent is not expressed as clearly as it should be, which has led to some confusion. Citations are to the 2011 ISO C++ standard. First, here's the evidence that it maps to a single '\n' character. A note in section 2.14.5 [lex.string]