[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] C11n: raw string literals
From: |
Vadim Zeitlin |
Subject: |
[lmi] C11n: raw string literals |
Date: |
Wed, 30 Nov 2016 18:39:08 +0100 |
Hello again,
I've opened a small PR introducing the use of C++11 raw string literals in
the few places where they seem to unequivocally make sense to me, please see
https://github.com/vadz/lmi/pull/48
Generally speaking, raw string literals seem useful to me in 2 situations:
1. Embedded regular expressions: as RE already often contain backslashes
and are generally punctuation-heavy, not doubling the backslashes in them
is a big gain for both readability and writeability and this is what
this PR covers.
2. Multiline string literals: IMHO raw strings are nicer than the usual
way of constructing such literals relying on the automatic concatenation
of adjacent string literals as it avoids the need to escape quotes
(which often occur in e.g. HTML text) and have literal "\n"s in the
string. However raw strings don't allow to indent their content (unless
you're ready to remove the extra indent at run-time) and I have no idea
which, if any, way of formatting them would you find most aesthetically
pleasant, so I didn't change any of them so far, please let me know if
you'd like to discuss it further. FWIW, I'd definitely like to be able
to use raw multiline string literals in the new code, so it would be
nice if you could set the rules for their use.
Thanks in advance,
VZ
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi] C11n: raw string literals,
Vadim Zeitlin <=