Topic: shorter syntax fro raw string literals (why can't


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon, 25 Nov 2013 19:50:25 +0200
Raw View
On 25 November 2013 19:40, Idan Bismut <idanbismut@gmail.com> wrote:
> I'm really happy the C++ community is live & kicking & keeps evolving
> towards better language & optimizations.
> In recent changes made to c++11, the "raw string literals" were added,
> and it really made we wonder why this can't be simpler than R("xxxxxxx").
> Is there any reason we couldn't "steal" c sharp idea & use the "@" sign ??
> Is @ reserved for anything in C++ ??
>
> I was just wondering, cause @"unescaped string" (for all cases) is much
> nicer & cleaner than raw literals currently in use (that has even delimiter
> syntx in case we want to have () in our text).


How do you embed quotes into such a 'raw' string?

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Greg Marr <gregmmarr@gmail.com>
Date: Mon, 25 Nov 2013 09:53:25 -0800 (PST)
Raw View
------=_Part_21_29991192.1385402005707
Content-Type: text/plain; charset=ISO-8859-1

On Monday, November 25, 2013 12:40:04 PM UTC-5, Idan Bismut wrote:
>
> why this can't be simpler than R("xxxxxxx").
> Is there any reason we couldn't "steal" c sharp idea & use the "@" sign ??
> Is @ reserved for anything in C++ ??
>
> I was just wondering, cause @"unescaped string" (for all cases) is much
> nicer & cleaner than raw literals currently in use (that has even delimiter
> syntx in case we want to have () in our text).
>

The reason to use raw string literals is to avoid having to escape \ and ".
 If you used @"xxxxx" then you lose the ability to have a " in your string,
which is at least half of the reason to use them in the first place.
 Really, the difference between R("abc") and @"abc" is only 2 characters,
so it's a major loss with little benefit.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_21_29991192.1385402005707
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Monday, November 25, 2013 12:40:04 PM UTC-5, Idan Bismu=
t wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">why t=
his can't be simpler than R("xxxxxxx").<br>Is there any reason we couldn't =
"steal" c sharp idea &amp; use the "@" sign ?? Is @ reserved for anything i=
n C++ ??<br><br>I was just wondering, cause @"unescaped string" (for all ca=
ses) is much nicer &amp; cleaner than raw literals currently in use (that h=
as even delimiter syntx in case we want to have () in our text).<br></div><=
/blockquote><div><br></div><div>The reason to use raw string literals is to=
 avoid having to escape \ and ". &nbsp;If you used @"xxxxx" then you lose t=
he ability to have a " in your string, which is at least half of the reason=
 to use them in the first place. &nbsp;Really, the difference between R("ab=
c") and @"abc" is only 2 characters, so it's a major loss with little benef=
it.</div></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_21_29991192.1385402005707--

.


Author: Tom Honermann <thonermann@coverity.com>
Date: Mon, 25 Nov 2013 13:12:35 -0500
Raw View
On 11/25/2013 12:40 PM, Idan Bismut wrote:
> I'm really happy the C++ community is live & kicking & keeps evolving
> towards better language & optimizations.
> In recent changes made to c++11, the "raw string literals" were added,
> and it really made we wonder why this can't be simpler than R("xxxxxxx").
> Is there any reason we couldn't "steal" c sharp idea & use the "@" sign
> ?? Is @ reserved for anything in C++ ??
>
> I was just wondering, cause @"unescaped string" (for all cases) is much
> nicer & cleaner than raw literals currently in use (that has even
> delimiter syntx in case we want to have () in our text).

The '@' character is not currently part of the basic source character
set in either C or C++ (C11 5.2.1p3, C++11 2.3p1).

Tom.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.