220 30994 <bf963a02-a82d-4c0b-b0e7-1bddc9f0e6cc@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: HarD Gamer <rodrigojose690@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: operator<< for std::string
Date: Mon, 20 Feb 2017 08:42:45 -0800 (PST)
Lines: 94
Approved: news@gmane.org
Message-ID: <bf963a02-a82d-4c0b-b0e7-1bddc9f0e6cc@isocpp.org>
References: <7552b5b4-e778-46a2-a6f8-fabca5b16dc4@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1000_1122804971.1487608965677"
X-Trace: blaine.gmane.org 1487608968 11561 195.159.176.226 (20 Feb 2017 16:42:48 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 20 Feb 2017 16:42:48 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCW7HXOKQ4BRBBVZVTCQKGQEGV65D6A@isocpp.org Mon Feb 20 17:42:43 2017
Return-path: <std-proposals+bncBCW7HXOKQ4BRBBVZVTCQKGQEGV65D6A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f198.google.com ([209.85.217.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCW7HXOKQ4BRBBVZVTCQKGQEGV65D6A@isocpp.org>)
	id 1cfr2v-0002Jb-50
	for gclcip-std-proposals@m.gmane.org; Mon, 20 Feb 2017 17:42:41 +0100
Original-Received: by mail-ua0-f198.google.com with SMTP id j56sf53685566uaa.0
        for <gclcip-std-proposals@m.gmane.org>; Mon, 20 Feb 2017 08:42:47 -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
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=QGp8LZqdHUD4WPy9qUDqCI+s5pCzQewV7sAhs7iLNS8=;
        b=RVkM3yLbFbRNkMC3JrJseBDA69w7g3josVNHOjIRJ3nZ3U7mavHKcjkhvDnwhceOFH
         gZ3KteITeNRL7ERfBVKY5susIzme9F4rRRTHcZr3vZvlmy7ndU1ScO+iZ+m53Ei2uj0z
         9Lzmo0GPS+IUkqS3rf2nrxbQrxGAeLVl5cSC1FfnSW4I68BM9HOOZ+tadOSlh8YZiLK8
         NK1IWJHkPouy2cb4EiD0uMPFD3ggvDFiSBWTN4FbA4Vc0aQf3sggwpe4hD9chGotMxpm
         7asmVIuBV5i2c6YMZqptabKFW37+U1UWEEFOLZslQ6AVM0Pe/i6Ar3BSUj+agk+uH/6Y
         qD5A==
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
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=QGp8LZqdHUD4WPy9qUDqCI+s5pCzQewV7sAhs7iLNS8=;
        b=rgpSaFA7OfYtY6mOWHB/pyp3d1Bb+zbfYmoSDz3GQCq+pZr3NkuRHLNYre18YCAy6n
         pCvg2aKzkKMsJ0nUAhuIO8vEEZJrrQ0oNpn+j5q4rdD7ApBXuoeukkagTwOSdBZmujFE
         K+/KQntyCe5Id8YWgv0vHVdGPUUgvznWq+MPhTxJzuSukqAKbwjnUpmAcq1UOSZvY2sI
         NEgolzFTXvXVtOXIKCK5BS8M0AMX56NMg5ba9rGm+bHF8RfTSUJOxpbh83NxmUUkNCzy
         oDPw/4nH3GAEKxHGJ/s+SsW5k4aV8nNfDgByKocs/P9CgBdB702sZJJBz6m/0FFZ8Uli
         q2+g==
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=QGp8LZqdHUD4WPy9qUDqCI+s5pCzQewV7sAhs7iLNS8=;
        b=GxAy/lo13uuwbFFRg54br/DLjAWleNKkkcUt2QYLFv9VNz7IcfS9qWTZ88fTLT2T3F
         g6pWWHsKdSNw1KhCu3MBDu7290uC6fokZC3/78h7jvMIOqe3gBY+W7BmvJBnrYp5tKjS
         fFXqedNnI45eC4FKKgtSwyjhhE6KUcr4pT22RFgy9XCVMwNu75AeblltNNRJQp4rLmSG
         d+fxDkLUwJJra5MbNaee5iuDqJLH4YuTynX0dVP9Yrr9n3MJRXM+8KdrAX7qcsTuYZn8
         jJOvRHLWYfLvB2ar701+OzRMKYQFwcRThQpKPANOslpVaGoVJybd/tyQrnQ5a5d0h353
         emWg==
X-Gm-Message-State: AMke39nXuX2anniTB0dkwA3qKcgrlLDMmYFzg2vmykUGgzymGe1+b55gaIPF/o6gu0dGjw==
X-Received: by 10.31.54.206 with SMTP id d197mr5670600vka.21.1487608966865;
        Mon, 20 Feb 2017 08:42:46 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.45.170 with SMTP id g39ls11366681otb.49.gmail; Mon, 20 Feb
 2017 08:42:46 -0800 (PST)
X-Received: by 10.157.12.1 with SMTP id 1mr1200881otr.2.1487608966178;
        Mon, 20 Feb 2017 08:42:46 -0800 (PST)
In-Reply-To: <7552b5b4-e778-46a2-a6f8-fabca5b16dc4@isocpp.org>
X-Original-Sender: rodrigojose690@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <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:30994
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/30994>

------=_Part_1000_1122804971.1487608965677
Content-Type: multipart/alternative; 
	boundary="----=_Part_1001_462247335.1487608965677"

------=_Part_1001_462247335.1487608965677
Content-Type: text/plain; charset=UTF-8



I think make ostringstream better is the solution

<https://lh3.googleusercontent.com/-tU9r3aNuWqM/WKscejsoQgI/AAAAAAAAATE/QhjaIZ75OT0IOeYdWDocDul-txdclboZgCLcB/s1600/ostrstr.png>
 

Em segunda-feira, 20 de fevereiro de 2017 12:55:03 UTC-3, Olaf van der Spek 
escreveu:
>
> Hi,
>
> One frequently needs to append stuff to strings, but the standard way (s 
> += "A" + "B" + to_string(42)) isn't optimal due to temporaries. Operator<< 
> for std::string seems like the obvious solution. It could support 
> string_view, integers, maybe floats but without formatting options.. It's 
> trivially extensible.
>
> s << "A" << "B" << 42;
>
> Would this be useful for the C++ std lib?
>
>

-- 
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/bf963a02-a82d-4c0b-b0e7-1bddc9f0e6cc%40isocpp.org.

------=_Part_1001_462247335.1487608965677
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><p class=3D"separator" style=3D"text-align: center; clear:=
 both;">I think make ostringstream better is the solution</p><p class=3D"se=
parator" style=3D"text-align: center; clear: both;"><a imageanchor=3D"1" hr=
ef=3D"https://lh3.googleusercontent.com/-tU9r3aNuWqM/WKscejsoQgI/AAAAAAAAAT=
E/QhjaIZ75OT0IOeYdWDocDul-txdclboZgCLcB/s1600/ostrstr.png" style=3D"margin-=
left: 1em; margin-right: 1em;"><img src=3D"https://lh3.googleusercontent.co=
m/-tU9r3aNuWqM/WKscejsoQgI/AAAAAAAAATE/QhjaIZ75OT0IOeYdWDocDul-txdclboZgCLc=
B/s320/ostrstr.png" border=3D"0" style=3D"" width=3D"320" height=3D"144"></=
a></p>=C2=A0<br><br>Em segunda-feira, 20 de fevereiro de 2017 12:55:03 UTC-=
3, Olaf van der Spek  escreveu:<blockquote class=3D"gmail_quote" style=3D"m=
argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"=
><div dir=3D"ltr"><span style=3D"font-family:arial,sans-serif;font-size:12.=
8px">Hi,</span><br style=3D"font-family:arial,sans-serif;font-size:12.8px">=
<br style=3D"font-family:arial,sans-serif;font-size:12.8px"><span style=3D"=
font-family:arial,sans-serif;font-size:12.8px">One frequently needs to appe=
nd stuff to strings, but the standard way=C2=A0</span><span style=3D"font-f=
amily:arial,sans-serif;font-size:12.8px">(s +=3D &quot;A&quot; + &quot;B&qu=
ot; + to_string(42)) isn&#39;t optimal due to temporaries.=C2=A0</span><spa=
n style=3D"font-family:arial,sans-serif;font-size:12.8px">Operator&lt;&lt; =
for std::string seems like the obvious solution.=C2=A0</span><span style=3D=
"font-family:arial,sans-serif;font-size:12.8px">It could support string_vie=
w, integers, maybe floats=C2=A0</span><span style=3D"font-family:arial,sans=
-serif;font-size:12.8px">but without formatting options..=C2=A0</span><font=
 face=3D"arial, sans-serif"><span style=3D"font-size:12.8px">It&#39;s trivi=
ally extensible.</span></font><br style=3D"font-family:arial,sans-serif;fon=
t-size:12.8px"><br style=3D"font-family:arial,sans-serif;font-size:12.8px">=
<span style=3D"font-family:arial,sans-serif;font-size:12.8px">s &lt;&lt; &q=
uot;A&quot; &lt;&lt; &quot;B&quot; &lt;&lt; 42;</span><br style=3D"font-fam=
ily:arial,sans-serif;font-size:12.8px"><br style=3D"font-family:arial,sans-=
serif;font-size:12.8px"><span style=3D"font-family:arial,sans-serif;font-si=
ze:12.8px">Would this be useful for the C++ std lib?</span><br><div><br></d=
iv></div></blockquote></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/bf963a02-a82d-4c0b-b0e7-1bddc9f0e6cc%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/bf963a02-a82d-4c0b-b0e7-1bddc9f0e6cc=
%40isocpp.org</a>.<br />

------=_Part_1001_462247335.1487608965677--

------=_Part_1000_1122804971.1487608965677--

.
