220 36842 <e71cfa25-b8f8-472b-b887-fdafd908145b@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: inkwizytoryankes@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: String interpolation
Date: Fri, 9 Feb 2018 10:47:35 -0800 (PST)
Lines: 193
Approved: news@gmane.org
Message-ID: <e71cfa25-b8f8-472b-b887-fdafd908145b@isocpp.org>
References: <356d5835-f1bf-4699-94f5-0b2d3d0b9c0e@isocpp.org>
 <1731062.NdW3nXAon1@tjmaciei-mobl1> <CALvx3haDVWHLQ4MJfEjeFWoh=JduvANZ+G61M9_x8H9+bU-xpA@mail.gmail.com>
 <14112472.AvYaaQfdXc@tjmaciei-mobl1> <CAC+0CCOKumW2SOvUEAPR4LdQfJDBXT7jvXPB0eMiznJ_6gCYhw@mail.gmail.com>
 <CAE1xPfd5X7_e9D4Xk=ZMKCF0WEEN+vw5xCW4FFXLkz_AcXSfPA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_5165_1945678765.1518202055226"
X-Trace: blaine.gmane.org 1518201942 2294 195.159.176.226 (9 Feb 2018 18:45:42 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 9 Feb 2018 18:45:42 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDDLTAGNTIBBBR6Z67JQKGQEPGALTVI@isocpp.org Fri Feb 09 19:45:38 2018
Return-path: <std-proposals+bncBDDLTAGNTIBBBR6Z67JQKGQEPGALTVI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f199.google.com ([209.85.217.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDDLTAGNTIBBBR6Z67JQKGQEPGALTVI@isocpp.org>)
	id 1ekDfv-0008QC-U3
	for gclcip-std-proposals@m.gmane.org; Fri, 09 Feb 2018 19:45:32 +0100
Original-Received: by mail-ua0-f199.google.com with SMTP id b45sf5278891uad.10
        for <gclcip-std-proposals@m.gmane.org>; Fri, 09 Feb 2018 10:47:37 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=+Q9oYOCzn4e6xW8FIxpm+Ms+dKZ7IM96QUv8rNEQlSY=;
        b=jL2FD8JzsijgzWscFGqNido7TeK1d1iDn+vyWOvG8fen6K55s/boVVKu1BFkZoCuOx
         NmThVz5uXmFJKfGEPcn1qkKT5NClZmJJnEVofpnujEzuspbQ5q+wyZ2HCqw55sBT8Wpq
         52vQAvPgUvmC4itljM70nAoC+MC67P1qhMvlNjdhKa43WEKcOSd48i0qiQEveyqywzPr
         0gGBNhYdZ2jIUDxGhU+GJFWSkv/V7K3C4APHpzbepJwpNPZmJZCwPVsJg/oqgbkugS0n
         xIe6FkA9OZeyMpIcImi7ezHPbKP4A864hN+TwFg5PfYAkMDm+1CM7NkG9VgLZofdk+qY
         lOnQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=+Q9oYOCzn4e6xW8FIxpm+Ms+dKZ7IM96QUv8rNEQlSY=;
        b=GineGCEifyJAeWI/loQqfohj8PwjyY+Jm6hL4Jax6iCIEdUzRPiwG1LgJAwtl232X+
         fdJb5zq/PVd9mMbNsC2r1iQM3QmY8yiMCdUtYRz9G/V79gGe1+bQjVb06wCxp/e2wDE/
         UBI5E/XgDEuR9GzWTGuv95ma2N9xC+hVSHr8DqcRxnsrcYcrBLBivVMqugpd6wJvGeDI
         jzNcW6oP+lk8MHyBPV8EkRUxEfRQgSkjoeFOjRRS9zhsmc1KS6/y7g2GNCjxPmfGaZR8
         b6gi4d8DTshdksN6DNzUzYRkCgJvXAjRS2NfHilE6tQRLNfwEAzVnRksjQon5FGWULSt
         sEwA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=+Q9oYOCzn4e6xW8FIxpm+Ms+dKZ7IM96QUv8rNEQlSY=;
        b=EpijGoSSEzaSYOWmuoKQSFgx2zO93tJzI0nJJ5+YDqWAHzP1x5sqU6uCt0VJN585qY
         sZktIGmy9HrjTYtMtkHvZVOdQYIOGIOvWU55Qe5SSJYkkpQ3M5MoCdGsfVbjd39nPEsR
         pFVr9W91zJZNLFqc/R7rEOfBrPvbo6bJM6/XiT/yuhpAExlRxux6ZEkT+yRz9ozODQHt
         M9OdiMVyeNi+/eLNRA96P3A/bswzy8+S4dpZbwbxObs/tF6RdEak+YATIPiL6oTZAOgg
         JXCt07RqC/4+1KDwxh6iiaCXsIm0hJAAjACRcMKNg8PrlHM3sZK+q4qfRomHDD/HgqF7
         gF3g==
X-Gm-Message-State: APf1xPCRezRnLn+jFwIbt/NjS/VeDlh+otB35WsGjhOXUZIHNv1J8Nth
	Pnw1ad7yfZfZw6XmZ14CGxoFVg==
X-Google-Smtp-Source: AH8x227aV+qrIXASEKI38fOHoJTgdgW6ZWBhE8HoHSpzwDxP0HUnJl+kBabjlt4SmhIWoyofPXNZRg==
X-Received: by 10.31.74.70 with SMTP id x67mr1771771vka.63.1518202057141;
        Fri, 09 Feb 2018 10:47:37 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.92.199 with SMTP id q190ls4098752vkb.8.gmail; Fri, 09 Feb
 2018 10:47:35 -0800 (PST)
X-Received: by 10.31.3.215 with SMTP id f84mr332967vki.9.1518202055652;
        Fri, 09 Feb 2018 10:47:35 -0800 (PST)
In-Reply-To: <CAE1xPfd5X7_e9D4Xk=ZMKCF0WEEN+vw5xCW4FFXLkz_AcXSfPA@mail.gmail.com>
X-Original-Sender: inkwizytoryankes@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:36842
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36842>

------=_Part_5165_1945678765.1518202055226
Content-Type: multipart/alternative; 
	boundary="----=_Part_5166_375610758.1518202055226"

------=_Part_5166_375610758.1518202055226
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



On Friday, February 9, 2018 at 3:07:32 PM UTC+1, Marcel Kr=C3=BCger wrote:
>
> Jake Arkinstall <jake.ar...@gmail.com <javascript:>> schrieb am Fr., 9.=
=20
> Feb. 2018 um 14:51 Uhr:
>
>>
>> That would be nice, but generic is a royal pain in the backside in this=
=20
>> circumstance. This is not something that can be written in the current=
=20
>> language because it requires interpetation of the strings. How on earth=
=20
>> that is supposed to generalise to choices of fmt, string conversion and=
=20
>> concatenation, stringstreams, and whatever magical solution we're waitin=
g=20
>> on to make string manipulation efficient, I have no idea, especially in =
the=20
>> general situation where the different approaches - e.g. to_string and=20
>> operator<< - are not equivalent.
>>
>
> Maybe this could be based on user-defined literals:
> If for example `operator""_sth` accepts more than two parameters, the=20
> expression "abc{def}ghij"_sth could be rewritten to `operator""_sth("abc"=
,=20
> 3, def, "ghij", 4)`.
> Then the standard library could include a literal suffix based on=20
> iostreams and it should be generic enough to be supported by most librari=
es.
>
> Best regards
> Marcel Kr=C3=BCger
>
=20
When reflection hit we can have this syntax:
auto f =3D "test {0.a} test {0.b} test"_str;
auto r1 =3D f(ArgType{ .a =3D 4, .b =3D 3 }); //"test 4 test 3 test"
auto r2 =3D f(OtherType{ .a =3D "zzz", .b =3D 42f, .c =3D true }); //"test =
zzz test=20
42.00 test"
auto r3 =3D f(5); //compile error! `int` do not have `a`

This is only matter of finding member address using compile time string.


--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/e71cfa25-b8f8-472b-b887-fdafd908145b%40isocpp.or=
g.

------=_Part_5166_375610758.1518202055226
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, February 9, 2018 at 3:07:32 PM UTC+1, M=
arcel Kr=C3=BCger wrote:<blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div d=
ir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">Jake Arkinstall &lt;=
<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"gYIuhJKF=
CQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&#39;;ret=
urn true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true;">jake.=
ar...@gmail.com</a>&gt; schrieb am Fr., 9. Feb. 2018 um 14:51=C2=A0Uhr:</di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:=
1px #ccc solid;padding-left:1ex"><div dir=3D"auto"><div dir=3D"auto"><br></=
div></div><div dir=3D"auto"><div dir=3D"auto">That would be nice, but gener=
ic is a royal pain in the backside in this circumstance. This is not someth=
ing that can be written in the current language because it requires interpe=
tation of the strings. How on earth that is supposed to generalise to choic=
es of fmt, string conversion and concatenation, stringstreams, and whatever=
 magical solution we&#39;re waiting on to make string manipulation efficien=
t, I have no idea, especially in the general situation where the different =
approaches - e.g. to_string and operator&lt;&lt; - are not equivalent.</div=
></div></blockquote><div><br></div><div>Maybe this could be based on user-d=
efined literals:</div><div>If for example `operator&quot;&quot;_sth` accept=
s more than two parameters, the expression &quot;abc{def}ghij&quot;_sth cou=
ld be rewritten to `operator&quot;&quot;_sth(&quot;abc&quot;, 3, def, &quot=
;ghij&quot;, 4)`.</div><div>Then the standard library could include a liter=
al suffix based on iostreams and it should be generic enough to be supporte=
d by most libraries.</div><div><br></div><div>Best regards</div><div>Marcel=
 Kr=C3=BCger</div></div></div></blockquote><div>=C2=A0<br>When reflection h=
it we can have this syntax:<br><div style=3D"background-color: rgb(250, 250=
, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width=
: 1px; overflow-wrap: break-word;" class=3D"prettyprint"><code class=3D"pre=
ttyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> f </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #080;" class=3D"styled-by-prettify">&quot=
;test {0.a} test {0.b} test&quot;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">_str</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">auto</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> r1=
 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"c=
olor: #606;" class=3D"styled-by-prettify">ArgType</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">.</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">a </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">4</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify">b </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prett=
ify">3</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">});</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">//&quot;test 4 test 3 test&q=
uot;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></=
span><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> r2 </span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> f</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #606;" cl=
ass=3D"styled-by-prettify">OtherType</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">a=
 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #080;" class=3D"styled-by-prettify">&quot;zzz&quot;</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify">b </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prett=
ify">42f</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">c </span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">true</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">});</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify">//&quot=
;test zzz test 42.00 test&quot;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">auto</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> r3 </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #066;" class=3D"styled-by-prettify">5</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;"=
 class=3D"styled-by-prettify">//compile error! `int` do not have `a`</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div>=
</code></div><br>This is only matter of finding member address using compil=
e time string.<br><br><br></div></div>

<p></p>

-- <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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/e71cfa25-b8f8-472b-b887-fdafd908145b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e71cfa25-b8f8-472b-b887-fdafd908145b=
%40isocpp.org</a>.<br />

------=_Part_5166_375610758.1518202055226--

------=_Part_5165_1945678765.1518202055226--

.
