Document number | Nnnnn=yy-nnnn |
Date: | yyyy-mm-dd |
Project | Programming Language C++, Library Working Group |
Reply-to | this document |
- This
- Introduction
- Motivation and Scope
- Impact
- Design Decisions
- Technical Specifications
- Acknowledgements
- References
- Allow any character other than a
"
in quoted strings. The"
character itself needs to be escaped\"
if included in"
to a closing"
. All regular escape handling can be done, but other literal characters like'\t'
or'\n'
that are in the source between quotes should be included as that literal character.
- Allows multiline strings for basically free; although the existing string-constant concatenation handles this in a perhaps more usable way, it could still be nice for including things like SQL scripts with newlines as just copy and paste with only slighty modification, instead of modifying every single line; long text blocks like certificates can also benefit.
- All valid code previously written still behaves the same way.
- There's lot a lot of reason to require that the end of a line
\r
,\r\n
or '\n` should cause an error in a string. Well, then again, I work with version control that checks in sources the same as it checks them out; there may be systems that change line endings and cause failures in expected output.
- None Provided
- None known, no previous proposals have been mentioned.
- C++ 17 Standard draft
- C11 standard draft
Generlize strings to allow any characters in them except themselves, which ahve to be escaped (as now) """ for instance. And then only " and \ are absolutely required to be escaped. (I'm going to say this next part badly) the literal " "test\nwrapped string" " err "test\nwrapped string" (where \n isliterally codepoint 10). Does not break any existing code. Allows multiline strings.