220 36860 <CAC+0CCM-e6Ghg_KOGP9Cpm5NKvgkLSpcyV05+ksP2PmVBzXoQw@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Jake Arkinstall <jake.arkinstall@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: String interpolation
Date: Sat, 10 Feb 2018 13:31:46 +0000
Lines: 312
Approved: news@gmane.org
Message-ID: <CAC+0CCM-e6Ghg_KOGP9Cpm5NKvgkLSpcyV05+ksP2PmVBzXoQw@mail.gmail.com>
References: <356d5835-f1bf-4699-94f5-0b2d3d0b9c0e@isocpp.org>
 <CAMD6iD9aT26x8GQHnQL+kuj3Rq8fVQSfYYFtvTnFidkf6jU_ag@mail.gmail.com>
 <25CCF885-86AD-4D51-8F5C-C46376D34DE0@gmail.com> <4890431.TR9UepuQra@tjmaciei-mobl1>
 <CALvx3hac77b6Z=EOWzKqynALi1-352OvY0dnnOer8rN6tfa01g@mail.gmail.com>
 <1cdb6300-7397-46d7-bce9-62e6e8dac40b@isocpp.org> <CAC+0CCOSZHaTA=YPSDU8Add7mE_BYcYPRCmGW8TRPtZhdqL8Hw@mail.gmail.com>
 <4bce681e-e729-4124-9322-69291fdb6678@isocpp.org> <f5feb9a0-99d3-433a-ae46-af34c8d00a61@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="001a113ceaeea848c80564dbaa41"
X-Trace: blaine.gmane.org 1518269406 2521 195.159.176.226 (10 Feb 2018 13:30:06 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 10 Feb 2018 13:30:06 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDCZX3WUUQFRBRHI7PJQKGQETPKJV2Q@isocpp.org Sat Feb 10 14:30:02 2018
Return-path: <std-proposals+bncBDCZX3WUUQFRBRHI7PJQKGQETPKJV2Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ot0-f199.google.com ([74.125.82.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDCZX3WUUQFRBRHI7PJQKGQETPKJV2Q@isocpp.org>)
	id 1ekVDr-0007pN-Uo
	for gclcip-std-proposals@m.gmane.org; Sat, 10 Feb 2018 14:29:44 +0100
Original-Received: by mail-ot0-f199.google.com with SMTP id m10sf6193596oth.13
        for <gclcip-std-proposals@m.gmane.org>; Sat, 10 Feb 2018 05:31:49 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1518269509; cv=pass;
        d=google.com; s=arc-20160816;
        b=bg/01yg+8vqKwfv+PNo/TG4uozf+UEQ027JrFxtLlf0UFQ4eLw3hLaiGPJZjemQnhE
         mM+sPw2jm2naI0uQ/1zxByYSkZTmFGhZy93flEMIz8bNP0YfIcdYwjNY0s11nQNO2o4y
         l1PMgdjj/g/LTLf0/6ZY4DLq+mu3D2x1moOy/WBIMsBEZMv/0mmf876x6TL6amzAVzac
         5EN84gWayLQbjE7bqMLvdQUZdo9AjFXI/cpYnbyJI0xP673I4MubCwqrxNlTu4lNc8+j
         W5QP8u2joZ74RW4IVbP+6lW88fZWhmyKLRQdRPiYanjLZzdryaz9uDV5K//iCK8Ufntg
         YBCA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=QaV9cHwdyRoCbbSRa1fO5DeIU24xEm7PXaEsyjXFXbA=;
        b=JrSCGLm6stBV2xPcTJHSGoX2pHbEwJRtof62hs2+UV9DbfSAUTkV4NPtcpO0VI7KpE
         ZDI2OfFipTwSjiClVzEdqcXDTwVuM1i3rhCnbHMTdER4TWnZFlcbAmpOctMT+WmABXEN
         T5mmmRCxLVAMw/c5cDW7IKQwH+12NMLni5eiClJdDWsAnh1WC+i4Rjvt+WV8BH453kMg
         a1zqO7awTzPcxkIKeboMPG+19FksGHc5UxdozZ2VEcBB4K/jbAtgkD0daHCz7x9PvTso
         YOvdBvl54EPO3yysvxynufQ6PX6CADhzsyOuyg+79YfYbSUhhUbYmqRzonOP1AUYH1L8
         MRiw==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=aa0OgCmE;
       spf=pass (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jake.arkinstall@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=QaV9cHwdyRoCbbSRa1fO5DeIU24xEm7PXaEsyjXFXbA=;
        b=Dg/BIWhKcTwqwvNUrQMsKE5Aa/snGrqF1YnlOkPZ6uRdQ+MoGB+h5QzankJG3Ga0Nr
         Lk7D5Cuoo5TeHwu7piGAhhjVkE5FWMxkRLkk2QKbE2qA2fFwVHdw17tXPXHeW+RI7O1V
         5E9NSoIP5yAa04LrZYNqSWXaIlIEqkHJUoqI4CW1r+sZ4neSW0t8epNTJyN4iTLewExp
         U/IdDkkMJICYaNZNBQA0wfwVfqTG9Ce21RLZ7hLJosMQ9YmX1tkykiEitg+pk+iiyA6b
         YCF9Bv/xp7iWiNo+AqyYiKOyg+BYNOh7IyehIe1p9SEGfSgl3aSxUtsidG1fNEjRerxI
         qPKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=QaV9cHwdyRoCbbSRa1fO5DeIU24xEm7PXaEsyjXFXbA=;
        b=CKGtOUZ+b/AuTLU3NG7W9X6M7/WMwggvPuOSK6zYvpQJaH55sFXyak08K+rJmRmdmc
         uSzvNpVyL3lt0zAXraLntr/Mfqu3oQzXRVeWcKQ+F8oQxhyYDxfTqG5lDuFN3KkiYeIF
         Kl0rtUlNrzo/1LTngcqWhrHlBET4zxBcBOTE9moP4fCCbvVbZ5frP5xN9fw/oOYi2DSj
         qUxxSyhLDRhu1NmkNQGFNVhqqsdPKAoAPPQkyKHB8aSYmcTeYqWVnHGoV8oGuw73SYNc
         ZazVXIe6c7s48MXqUp58nOwV/QhAUzUrtz98cGLbvbEJqBPcAk7zsIsNLU3y47D7S7G/
         mKBA==
X-Gm-Message-State: APf1xPDMffywF4s3c6CVXDPT6HnipX32KL+7XtUd5tM8NvnNQfcFHhPy
	h6P0ko8zO4NqClIpR56UPNDcIg==
X-Google-Smtp-Source: AH8x2277izoab7d6mg9/Fu8key9UA6XTZrfU5FwfPkPgLZcTAO9KYVfSuDczfpPUDnPHLHZE43yxAA==
X-Received: by 10.202.88.11 with SMTP id m11mr3017071oib.14.1518269509211;
        Sat, 10 Feb 2018 05:31:49 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.15.202 with SMTP id m10ls5627636otd.19.gmail; Sat, 10 Feb
 2018 05:31:47 -0800 (PST)
X-Received: by 10.157.87.101 with SMTP id x34mr4978837oti.132.1518269507952;
        Sat, 10 Feb 2018 05:31:47 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1518269507; cv=none;
        d=google.com; s=arc-20160816;
        b=WJHZ9JfhDEoDli0JYLZ5q7TJb/wMSpAlxLglieq39BhveylvxZTpukf0+taunzVpCc
         lkuc20vk0KBi1Onj6EQjNZtSX6AFtvbrSooXpjwC/poanHRV72UAHPvW85+CYffKuJHy
         VLmjHQc1RnVhFr5RGCMYwiDtDL8sgMm0WIqWVEHKiul/fLOYfMu655AzUg/7kRxRRl2v
         6KJHAJVesnWg/IxRUZyvYMU5RdPyZoTPxGgKqPxWuR4lFGZb8aU1Ih0cpjqKldEnzI0w
         gl5cGsqyhGTm4rxSUTKlwDIXyBCscuMyt44FH0psjuaM/rdtijr6Z1UWOpuDF3NYQ/J3
         YShg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=cBcTHiH61pFM7OlbyGWQtgYKltrjjzKwFl+WnsF5L+w=;
        b=MfR2d8egHlqfvmOcg6lydhbYeGptqi/9la9SN0n+zVVvKPPPr2VeWWMAImL5rw87Oo
         NIZOgHb3D933xnK4OBJVTDGKpxmdpjXQmkFxb7LPn522fZJFGDTR5sQndskKgKcyK28d
         piG8lwodrh50BNEF2KPqjFTtjp8fKsfUYxODon1UNRBDy4H4h/2tHhvASfv+iqaBV8n8
         5ivdBqsPoqXtPi1v9a8F70BCMlzoe8tOH6+83qmCXzd1IUspXlcuCzSOdOfQFmXUe0Zw
         9yyo33iZ83fhbzerz4SCpAMDc6yvqlsZo9JL+mzbUv4VEnQ11ga3JIdZWK4qa+Gfu5vv
         X47g==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=aa0OgCmE;
       spf=pass (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jake.arkinstall@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65])
        by mx.google.com with SMTPS id 25sor1857339oir.105.2018.02.10.05.31.47
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Sat, 10 Feb 2018 05:31:47 -0800 (PST)
Received-SPF: pass (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65;
X-Received: by 10.202.168.14 with SMTP id r14mr4114451oie.289.1518269507322;
 Sat, 10 Feb 2018 05:31:47 -0800 (PST)
Original-Received: by 10.168.151.129 with HTTP; Sat, 10 Feb 2018 05:31:46 -0800 (PST)
Original-Received: by 10.168.151.129 with HTTP; Sat, 10 Feb 2018 05:31:46 -0800 (PST)
In-Reply-To: <f5feb9a0-99d3-433a-ae46-af34c8d00a61@isocpp.org>
X-Original-Sender: jake.arkinstall@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=aa0OgCmE;       spf=pass
 (google.com: domain of jake.arkinstall@gmail.com designates 209.85.220.65 as
 permitted sender) smtp.mailfrom=jake.arkinstall@gmail.com;       dmarc=pass
 (p=NONE sp=QUARANTINE dis=NONE) header.from=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:36860
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36860>

--001a113ceaeea848c80564dbaa41
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Im a bit confused about the suggestion but it appears that the input is an
int, where the name and age are outputs. In this scenario, the _sql parser
(provided by some library) could convert that to

db.run("select name, age from table where id =3D " + db::int_input(id),
db::string_output(name), db::int_output(age));

which sets the name and age variables to the name and age columns. Adding
sql sanitisers is then done via the db::*_input methods. It just might be
possible. It would require a lot of compile-time parsing, and so a proposal
to allow this would probably need to include a bunch of mechanisms to
process string literals at compile time, but it's interesting.

I'm not sure about that exact idea, but the point is the creativity - a way
of a library being able to parse a string literal, putting code in its
place which in turn gets compiled, would give a lot more flexibility to
libraries, and let them get very creative. It could open the door to
libraries providing syntactic sugar that still provides efficient code. A
language within a language.


On 10 Feb 2018 05:30, "Nicol Bolas" <jmckesson@gmail.com> wrote:



On Friday, February 9, 2018 at 5:12:26 PM UTC-5, Marcin Jaczewski wrote:
>
>
>
> On Friday, February 9, 2018 at 10:13:10 PM UTC+1, Jake Arkinstall wrote:
>>
>>
>>
>> On 9 Feb 2018 20:51, <inkwizyt...@gmail.com> wrote:
>>
>>
>> Minimal version than could be added to C++ is new string prefix `F`
>> (because we have `R`, `u`, `u8` and `U` already, and `$` is outside of
>> source characters) that enable mixing code with string literals.
>> As Marcel Kr=C3=BCger wrote, language could transform this string litera=
l to:
>> F"testA{a}test{{B}}"_x; =3D> operator""_x("testA"_x, a, "test{B}"_x); //=
using
>> same postfix to parse sub-literals
>> FR"aa(x{b}y)aa"_x; =3D> operator""_x(R"aa(x)aa"_x, b, R"aa(y)aa"_x); //i=
t
>> have precedence over `R` prefix
>>
>>
>>
>> Rest will be implemented by library, this mean `F"a {5} b"` will not
>> compile because there is no matching operator. stl could add this operat=
or
>> for `s` postfix, that will use `std::to_string` for conversing all
>> arguments:
>> template<typename... Parts>
>> std::string operator""s(Parts&&... p) { return std::to_string(std::
>> forward<Parts>(p)) + ...; }
>>
>> int main()
>> {
>>     auto x =3D F"Test {{a}} =3D {10+5}"s; //x =3D=3D "Test {a} =3D 15"s
>> }
>> No iosteam, and even more it could if someone relay desire to have
>> localizations:
>>
>> F"Test {356*10}"_loc("Prod {0} OK!", "fr") =3D=3D "Prod 3.560,00 OK!";
>>
>> Only drawback is some template bloat but this is probably acceptable cos=
t.
>>
>>
>> This is exactly the kind of thing I'm aiming for, although I dont believ=
e
>> string conversion and concatenation to be the final solution - unless my
>> recall of benchmarks is out of date, streams are faster than string
>> concatenation.
>>
>> This being said, similar ideas can be applied to utilise the fmt library=
,
>> for example.
>>
>
> This is irrelevant, how it will be implemented is QoI, It could be done
> using `snprintf`, or even not implemented at all, only prefix `F`and its
> transformation is important.
>
> More I think about this more it look as great addition to language:
> std::string a;
> int b =3D 0;
> int c =3D 42;
> db.run(F"select name as {a}, age as {b} from table where id =3D {c}"_sql)=
;
>
>
If how this is implemented is a mere implementation detail, how would you
make it use bound parameters or otherwise sanitize string inputs? Have we
learned nothing from Little Bobby Tables <https://xkcd.com/327/>?

Indeed, this seems like a justification to *not* provide this feature.

--=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
email 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/f5feb9a0-99d3-433a-
ae46-af34c8d00a61%40isocpp.org
<https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/f5feb9a0-99d3=
-433a-ae46-af34c8d00a61%40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter=
>
..

--=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/CAC%2B0CCM-e6Ghg_KOGP9Cpm5NKvgkLSpcyV05%2BksP2Pm=
VBzXoQw%40mail.gmail.com.

--001a113ceaeea848c80564dbaa41
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div>Im a bit confused about the suggestion but it appear=
s that the input is an int, where the name and age are outputs. In this sce=
nario, the _sql parser (provided by some library) could convert that to</di=
v><div dir=3D"auto"><br></div><div dir=3D"auto">db.run(&quot;select name, a=
ge from table where id =3D &quot; + db::int_input(id), db::string_output(na=
me), db::int_output(age));</div><div dir=3D"auto"><br></div><div dir=3D"aut=
o">which sets the name and age variables to the name and age columns. Addin=
g sql sanitisers is then done via the db::*_input methods. It just might be=
 possible. It would require a lot of compile-time parsing, and so a proposa=
l to allow this would probably need to include a bunch of mechanisms to pro=
cess string literals at compile time, but it&#39;s interesting.</div><div d=
ir=3D"auto"><br></div><div dir=3D"auto">I&#39;m not sure about that exact i=
dea, but the point is the creativity - a way of a library being able to par=
se a string literal, putting code in its place which in turn gets compiled,=
 would give a lot more flexibility to libraries, and let them get very crea=
tive. It could open the door to libraries providing syntactic sugar that st=
ill provides efficient code. A language within a language.</div><div dir=3D=
"auto"><br><div class=3D"gmail_extra" dir=3D"auto"><br><div class=3D"gmail_=
quote">On 10 Feb 2018 05:30, &quot;Nicol Bolas&quot; &lt;<a href=3D"mailto:=
jmckesson@gmail.com">jmckesson@gmail.com</a>&gt; wrote:<br type=3D"attribut=
ion"><blockquote class=3D"quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"quoted-text"><=
br><br>On Friday, February 9, 2018 at 5:12:26 PM UTC-5, Marcin Jaczewski wr=
ote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br>On Fri=
day, February 9, 2018 at 10:13:10 PM UTC+1, Jake Arkinstall wrote:<blockquo=
te class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"auto"><div><br><div><br><div cla=
ss=3D"gmail_quote">On 9 Feb 2018 20:51,  &lt;<a rel=3D"nofollow">inkwizyt..=
..@gmail.com</a>&gt; wrote:<br type=3D"attribution"><blockquote style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
"><div><br></div><div>Minimal version than could be added to C++ is new str=
ing prefix `F` (because we have `R`, `u`, `u8` and `U` already, and `$` is =
outside of source characters) that enable mixing code with string literals.=
<br>As Marcel Kr=C3=BCger wrote, language could transform this string liter=
al to:<br><div style=3D"background-color:rgb(250,250,250);border-color:rgb(=
187,187,187);border-style:solid;border-width:1px"><code><div><span style=3D=
"color:#000">F</span><span style=3D"color:#080">&quot;testA{a}test{{B}}&quo=
t;</span><span style=3D"color:#000">_x</span><span style=3D"color:#660">;</=
span><span style=3D"color:#000"> </span><span style=3D"color:#660">=3D&gt;<=
/span><span style=3D"color:#000"> </span><span style=3D"color:#008">operato=
r</span><span style=3D"color:#080">&quot;&quot;</span><span style=3D"color:=
#000">_x</span><span style=3D"color:#660">(</span><span style=3D"color:#080=
">&quot;testA&quot;</span><span style=3D"color:#000">_x</span><span style=
=3D"color:#660">,</span><span style=3D"color:#000"> a</span><span style=3D"=
color:#660">,</span><span style=3D"color:#000"> </span><span style=3D"color=
:#080">&quot;test{B}&quot;</span><span style=3D"color:#000">_x</span><span =
style=3D"color:#660">);</span><span style=3D"color:#000"> </span><span styl=
e=3D"color:#800">//using same postfix to parse sub-literals</span><span sty=
le=3D"color:#000"><br>FR</span><span style=3D"color:#080">&quot;aa(x{b}y)aa=
&quot;</span><span style=3D"color:#000">_x</span><span style=3D"color:#660"=
>;</span><span style=3D"color:#000"> </span><span style=3D"color:#660">=3D&=
gt;</span><span style=3D"color:#000"> </span><span style=3D"color:#008">ope=
rator</span><span style=3D"color:#080">&quot;&quot;</span><span style=3D"co=
lor:#000">_x</span><span style=3D"color:#660">(</span><span style=3D"color:=
#000">R</span><span style=3D"color:#080">&quot;aa(x)aa&quot;</span><span st=
yle=3D"color:#000">_x</span><span style=3D"color:#660">,</span><span style=
=3D"color:#000"> b</span><span style=3D"color:#660">,</span><span style=3D"=
color:#000"> R</span><span style=3D"color:#080">&quot;aa(y)aa&quot;</span><=
span style=3D"color:#000">_x</span><span style=3D"color:#660">);</span><spa=
n style=3D"color:#000"> </span><span style=3D"color:#800">//it have precede=
nce over `R` prefix</span></div></code></div><br><br><br>Rest will be imple=
mented by library, this mean `F&quot;a {5} b&quot;` will not compile becaus=
e there is no matching operator. stl could add this operator for `s` postfi=
x, that will use `std::to_string` for conversing all arguments:<br><div sty=
le=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);borde=
r-style:solid;border-width:1px"><code><div><span style=3D"color:#008">templ=
ate</span><span style=3D"color:#660">&lt;</span><span style=3D"color:#008">=
typename</span><span style=3D"color:#660">...</span><span style=3D"color:#0=
00"> </span><span style=3D"color:#606">Parts</span><span style=3D"color:#66=
0">&gt;</span><span style=3D"color:#000"><br>std</span><span style=3D"color=
:#660">::</span><span style=3D"color:#008">string</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#008">operator</span><span style=3D"co=
lor:#080">&quot;&quot;</span><span style=3D"color:#000">s</span><span style=
=3D"color:#660">(</span><span style=3D"color:#606">Parts</span><span style=
=3D"color:#660">&amp;&amp;...</span><span style=3D"color:#000"> p</span><sp=
an style=3D"color:#660">)</span><span style=3D"color:#000"> </span><span st=
yle=3D"color:#660">{</span><span style=3D"color:#000"> </span><span style=
=3D"color:#008">return</span><span style=3D"color:#000"> std</span><span st=
yle=3D"color:#660">::</span><span style=3D"color:#000">to_string</span><spa=
n style=3D"color:#660">(</span><span style=3D"color:#000">std</span><span s=
tyle=3D"color:#660">::</span><span style=3D"color:#000">forward</span><span=
 style=3D"color:#660">&lt;</span><span style=3D"color:#606">Pa<wbr>rts</spa=
n><span style=3D"color:#660">&gt;(</span><span style=3D"color:#000">p</span=
><span style=3D"color:#660">))</span><span style=3D"color:#000"> </span><sp=
an style=3D"color:#660">+</span><span style=3D"color:#000"> </span><span st=
yle=3D"color:#660">...;</span><span style=3D"color:#000"> </span><span styl=
e=3D"color:#660">}</span><span style=3D"color:#000"><br><br></span><span st=
yle=3D"color:#008">int</span><span style=3D"color:#000"> main</span><span s=
tyle=3D"color:#660">()</span><span style=3D"color:#000"><br></span><span st=
yle=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </s=
pan><span style=3D"color:#008">auto</span><span style=3D"color:#000"> x </s=
pan><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> F</spa=
n><span style=3D"color:#080">&quot;Test {{a}} =3D {10+5}&quot;</span><span =
style=3D"color:#000">s</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"> </span><span style=3D"color:#800">//x =3D=3D &quot;Test {a=
} =3D 15&quot;s</span><span style=3D"color:#000"><br></span><span style=3D"=
color:#660">}</span><span style=3D"color:#000"><br></span></div></code></di=
v><code>No iosteam, and even more it could if someone relay desire to have =
localizations:<br><br><div style=3D"background-color:rgb(250,250,250);borde=
r-color:rgb(187,187,187);border-style:solid;border-width:1px"><code><div><s=
pan style=3D"color:#000">F</span><span style=3D"color:#080">&quot;Test {356=
*10}&quot;</span><span style=3D"color:#000">_loc</span><span style=3D"color=
:#660">(</span><span style=3D"color:#080">&quot;Prod {0} OK!&quot;</span><s=
pan style=3D"color:#660">,</span><span style=3D"color:#000"> </span><span s=
tyle=3D"color:#080">&quot;fr&quot;</span><span style=3D"color:#660">)</span=
><span style=3D"color:#000"> </span><span style=3D"color:#660">=3D=3D</span=
><span style=3D"color:#000"> </span><span style=3D"color:#080">&quot;Prod 3=
..560,00 OK!&quot;</span><span style=3D"color:#660">;</span><span style=3D"c=
olor:#000"><br></span></div></code></div><br>Only drawback is some template=
 bloat but this is probably acceptable cost.</code></div></div></blockquote=
></div></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">This is ex=
actly the kind of thing I&#39;m aiming for, although I dont believe string =
conversion and concatenation to be the final solution - unless my recall of=
 benchmarks is out of date, streams are faster than string concatenation.</=
div><div dir=3D"auto"><br></div><div dir=3D"auto">This being said, similar =
ideas can be applied to utilise the fmt library, for example.</div></div></=
blockquote><div>=C2=A0<br>This is irrelevant, how it will be implemented is=
 QoI, It could be done using `snprintf`, or even not implemented at all, on=
ly prefix `F`and its transformation is important.<br><br>More I think about=
 this more it look as great addition to language:<br><div style=3D"backgrou=
nd-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;=
border-width:1px"><code><div><span style=3D"color:#000">std</span><span sty=
le=3D"color:#660">::</span><span style=3D"color:#008">string</span><span st=
yle=3D"color:#000"> a</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"><br></span><span style=3D"color:#008">int</span><span style=
=3D"color:#000"> b </span><span style=3D"color:#660">=3D</span><span style=
=3D"color:#000"> </span><span style=3D"color:#066">0</span><span style=3D"c=
olor:#660">;</span><span style=3D"color:#000"><br></span><span style=3D"col=
or:#008">int</span><span style=3D"color:#000"> c </span><span style=3D"colo=
r:#660">=3D</span><span style=3D"color:#000"> </span><span style=3D"color:#=
066">42</span><span style=3D"color:#660">;</span><span style=3D"color:#000"=
><br>db</span><span style=3D"color:#660">.</span><span style=3D"color:#000"=
>run</span><span style=3D"color:#660">(</span><span style=3D"color:#000">F<=
/span><span style=3D"color:#080">&quot;select name as {a}, age as {b} from =
table where id =3D {c}&quot;</span><span style=3D"color:#000">_sql</span><s=
pan style=3D"color:#660">);</span><span style=3D"color:#000"><br><br></span=
></div></code></div></div></div></blockquote></div><div><br>If how this is =
implemented is a mere implementation detail, how would you make it use boun=
d parameters or otherwise sanitize string inputs? Have we learned nothing f=
rom <a href=3D"https://xkcd.com/327/" target=3D"_blank">Little Bobby Tables=
</a>?<br><br>Indeed, this seems like a justification to <i>not</i> provide =
this feature.<br></div></div><div class=3D"quoted-text">

<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" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></div>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/f5feb9a0-99d3-433a-ae46-af34c8d00a61%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/f5fe=
b9a0-99d3-433a-<wbr>ae46-af34c8d00a61%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div></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/CAC%2B0CCM-e6Ghg_KOGP9Cpm5NKvgkLSpcyV=
05%2BksP2PmVBzXoQw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCM-e6=
Ghg_KOGP9Cpm5NKvgkLSpcyV05%2BksP2PmVBzXoQw%40mail.gmail.com</a>.<br />

--001a113ceaeea848c80564dbaa41--

.
