I recently learned about raw string literals and, OMG!
<https://en.cppreference.com/w/cpp/language/string_literal.html>
and
<https://en.cppreference.com/w/cpp/language/user_literal.html>
I recently learned about raw string literals and, OMG!
<https://en.cppreference.com/w/cpp/language/string_literal.html>
and
<https://en.cppreference.com/w/cpp/language/user_literal.html>
Am 11.04.2026 um 13:24 schrieb Chris Ahlstrom:
I recently learned about raw string literals and, OMG!
<https://en.cppreference.com/w/cpp/language/string_literal.html>
and
<https://en.cppreference.com/w/cpp/language/user_literal.html>
These string literals make sense for regex-string with a lot of "\"s.
I am using raw literals all the time for embedding pieces of other
languages inside C++ (HTML, Markdown, JSON, scripting languages, etc),
works very nicely.
On 4/11/2026 2:24 PM, Chris Ahlstrom wrote:
I recently learned about raw string literals and, OMG!
<https://en.cppreference.com/w/cpp/language/string_literal.html>
and
<https://en.cppreference.com/w/cpp/language/user_literal.html>
I am using raw literals all the time for embedding pieces of other
languages inside C++ (HTML, Markdown, JSON, scripting languages, etc),
works very nicely.
I was told I should use external resource files for that, but honestly I
do not see much point in that. Why should I make my life more
complicated than needed? There are more than enough complications already.
Because unless its a personal project someone will have to debug and
modify the logical mess that literals give rise to.
On Mon, 13 Apr 2026 15:21:33 +0300
Paavo Helde <eesnimi@osa.pri.ee> gabbled:
On 4/11/2026 2:24 PM, Chris Ahlstrom wrote:
I recently learned about raw string literals and, OMG!
ÿÿÿÿ <https://en.cppreference.com/w/cpp/language/string_literal.html>
and
ÿÿÿÿ <https://en.cppreference.com/w/cpp/language/user_literal.html>
I am using raw literals all the time for embedding pieces of other
languages inside C++ (HTML, Markdown, JSON, scripting languages, etc),
works very nicely.
I was told I should use external resource files for that, but honestly
I do not see much point in that. Why should I make my life more
complicated than needed? There are more than enough complications
already.
Because unless its a personal project someone will have to debug and
modify the logical mess that literals give rise to.
On 4/14/2026 12:25 PM, boltar@caprica.universe wrote:
On Mon, 13 Apr 2026 15:21:33 +0300
Paavo Helde <eesnimi@osa.pri.ee> gabbled:
On 4/11/2026 2:24 PM, Chris Ahlstrom wrote:
I recently learned about raw string literals and, OMG!
ÿÿÿÿ <https://en.cppreference.com/w/cpp/language/string_literal.html>
and
ÿÿÿÿ <https://en.cppreference.com/w/cpp/language/user_literal.html>
I am using raw literals all the time for embedding pieces of other
languages inside C++ (HTML, Markdown, JSON, scripting languages, etc),
works very nicely.
I was told I should use external resource files for that, but honestly
I do not see much point in that. Why should I make my life more
complicated than needed? There are more than enough complications
already.
Because unless its a personal project someone will have to debug and
modify the logical mess that literals give rise to.
As always, any feature can be abused or overused. If raw string literals
do not suit the task at hand or the team preferences, one is free to not
use them.
On Wed, 15 Apr 2026 08:15:47 +0300
Paavo Helde <eesnimi@osa.pri.ee> gabbled:
On 4/14/2026 12:25 PM, boltar@caprica.universe wrote:
On Mon, 13 Apr 2026 15:21:33 +0300
Paavo Helde <eesnimi@osa.pri.ee> gabbled:
On 4/11/2026 2:24 PM, Chris Ahlstrom wrote:
I recently learned about raw string literals and, OMG!
ÿÿÿÿ <https://en.cppreference.com/w/cpp/language/string_literal.html> >>>>>
and
ÿÿÿÿ <https://en.cppreference.com/w/cpp/language/user_literal.html>
I am using raw literals all the time for embedding pieces of other
languages inside C++ (HTML, Markdown, JSON, scripting languages,
etc), works very nicely.
I was told I should use external resource files for that, but
honestly I do not see much point in that. Why should I make my life
more complicated than needed? There are more than enough
complications already.
Because unless its a personal project someone will have to debug and
modify the logical mess that literals give rise to.
As always, any feature can be abused or overused. If raw string
literals do not suit the task at hand or the team preferences, one is
free to not use them.
I prefer explicit code where possible. Having to track down what "_mypostfix"
actually does is a waste of everyones time.
On 4/15/2026 11:23 AM, boltar@caprica.universe wrote:
On Wed, 15 Apr 2026 08:15:47 +0300
Paavo Helde <eesnimi@osa.pri.ee> gabbled:
On 4/14/2026 12:25 PM, boltar@caprica.universe wrote:
On Mon, 13 Apr 2026 15:21:33 +0300
Paavo Helde <eesnimi@osa.pri.ee> gabbled:
On 4/11/2026 2:24 PM, Chris Ahlstrom wrote:
I recently learned about raw string literals and, OMG!
ÿÿÿÿ <https://en.cppreference.com/w/cpp/language/string_literal.html>
and
ÿÿÿÿ <https://en.cppreference.com/w/cpp/language/user_literal.html> >>>>>>
I am using raw literals all the time for embedding pieces of other
languages inside C++ (HTML, Markdown, JSON, scripting languages,
etc), works very nicely.
I was told I should use external resource files for that, but
honestly I do not see much point in that. Why should I make my life >>>>> more complicated than needed? There are more than enough
complications already.
Because unless its a personal project someone will have to debug and
modify the logical mess that literals give rise to.
As always, any feature can be abused or overused. If raw string
literals do not suit the task at hand or the team preferences, one is
free to not use them.
I prefer explicit code where possible. Having to track down what
"_mypostfix"
actually does is a waste of everyones time.
What _mypostfix? Ah, you are probably talking about user-defined
literals. I have not used those yet. I was talking about plain raw
string literals.
| Sysop: | Tetrazocine |
|---|---|
| Location: | Melbourne, VIC, Australia |
| Users: | 15 |
| Nodes: | 8 (0 / 8) |
| Uptime: | 180:27:18 |
| Calls: | 213 |
| Files: | 21,502 |
| Messages: | 84,274 |