220 18303 <CAFdMc-2w4s8YHinaUw4tQUv+VPu2EjtWt87xeOVe+THAkG2hig@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: "dgutson ." <danielgutson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: to_string(string)
Date: Fri, 29 May 2015 14:23:19 -0300
Lines: 75
Approved: news@gmane.org
Message-ID: <CAFdMc-2w4s8YHinaUw4tQUv+VPu2EjtWt87xeOVe+THAkG2hig@mail.gmail.com>
References: <CAFdMc-1o21Y5Cr9jfqGDoNv5Ss38WfveDVFFLoXD66ciigMCaw@mail.gmail.com>
	<CAGg_6+NmanLEAUy1sz9v6NQdS202TOv8xy9WFqxTbW-0ELkC+w@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1432920203 31562 80.91.229.3 (29 May 2015 17:23:23 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 29 May 2015 17:23:23 +0000 (UTC)
To: std-proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDE3NBMV6UFBBB6BUKVQKGQEQXXN6TQ@isocpp.org Fri May 29 19:23:22 2015
Return-path: <std-proposals+bncBDE3NBMV6UFBBB6BUKVQKGQEQXXN6TQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yk0-f200.google.com ([209.85.160.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDE3NBMV6UFBBB6BUKVQKGQEQXXN6TQ@isocpp.org>)
	id 1YyO09-0005fg-7I
	for gclcip-std-proposals@m.gmane.org; Fri, 29 May 2015 19:23:21 +0200
Original-Received: by ykfl8 with SMTP id l8sf55158560ykf.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 29 May 2015 10:23:20 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type:content-transfer-encoding
         :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=8C3hO8ygVbfpdkBAdcjwKbu1j+9ue/tGfQn3MJfODTo=;
        b=FQeBj8WdVokiQgq9W3sdAZW/kjZ87BLKhUZWmZbbwWBRL2NUNI43RCoFbLbQjYftoe
         jIqIlcVX4iC8TFTZ91wuglXwIexWg7Niu1ku3UCDz0egAOwkzkILl6Fo+7chdy28TBEJ
         rSCBq6VlHlH+sxrvuvCJepy5h+eu9Lo+ShLCfwpQagwS7ESpG3mE67hPnwT8TliAfsIi
         RzTHVijh1pZZ3t3BdtyvCcHZIgz0clxpEe62LoTq5WRoiK9cAeGq6E0FSKoJ/UJxOGwJ
         sEes4KCDmuCZnMIPHCbe6Y0o6FGwLxyrU2SBAxhxZ+jGfUi7KS3oeoQFgQqJWoRMB7u6
         LT/g==
X-Gm-Message-State: ALoCoQlUZBxy0sjEp5G5o6Eswjpq5WiCbWXcz+utXF80xGJD6xxv9S3sMHqrPHGnliaTkDHE5y87
X-Received: by 10.236.11.114 with SMTP id 78mr11087040yhw.22.1432920199990;
        Fri, 29 May 2015 10:23:19 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.86.149 with SMTP id p21ls1548186qgd.34.gmail; Fri, 29 May
 2015 10:23:19 -0700 (PDT)
X-Received: by 10.170.110.79 with SMTP id c76mr10728710ykb.108.1432920199279;
        Fri, 29 May 2015 10:23:19 -0700 (PDT)
Original-Received: from mail-yh0-x230.google.com (mail-yh0-x230.google.com. [2607:f8b0:4002:c01::230])
        by mx.google.com with ESMTPS id f66si3696475yka.27.2015.05.29.10.23.19
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 29 May 2015 10:23:19 -0700 (PDT)
Received-SPF: pass (google.com: domain of danielgutson@gmail.com designates 2607:f8b0:4002:c01::230 as permitted sender) client-ip=2607:f8b0:4002:c01::230;
Original-Received: by yhom41 with SMTP id m41so21123265yho.1
        for <std-proposals@isocpp.org>; Fri, 29 May 2015 10:23:19 -0700 (PDT)
X-Received: by 10.170.81.87 with SMTP id x84mr10750069ykx.113.1432920199169;
 Fri, 29 May 2015 10:23:19 -0700 (PDT)
Original-Received: by 10.129.90.213 with HTTP; Fri, 29 May 2015 10:23:19 -0700 (PDT)
In-Reply-To: <CAGg_6+NmanLEAUy1sz9v6NQdS202TOv8xy9WFqxTbW-0ELkC+w@mail.gmail.com>
X-Original-Sender: danielgutson@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of danielgutson@gmail.com designates 2607:f8b0:4002:c01::230 as
 permitted sender) smtp.mail=danielgutson@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE 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-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:18303
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/18303>

On Fri, May 29, 2015 at 2:13 PM, Nevin Liber <nevin@eviloverlord.com> wrote=
:
> On 29 May 2015 at 12:06, dgutson . <danielgutson@gmail.com> wrote:
>>
>> Is there any reason for the lack of an overloaded version of to_string
>> receiving a string? (in which case would work as the identity)
>> This is useful when the argument is a template argument.
>> For example:
>>
>> template <class T>
>> void f(T t)
>> {
>>     auto x =3D "Hello " + std::to_string(t);
>> }
>>
>> then call it with t=3D1, t=3D"World", etc.
>>
>> Sorry if I'm missing something too obvious.
>
>
> Perhaps to avoid an unintentional copy?

It shouldn't be necessary if the argument is const string& and the
return type is also const reference.
(the following snippet works for me:

namespace std
{
    const string& to_string(const string& x)
    {
        return x;
    }
}

)

>
> No real idea why, though.
>  Nevin :-)
> --
>  Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404
>
> --
>
> ---
> 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/.



--=20
Who=E2=80=99s got the sweetest disposition?
One guess, that=E2=80=99s who?
Who=E2=80=99d never, ever start an argument?
Who never shows a bit of temperament?
Who's never wrong but always right?
Who'd never dream of starting a fight?
Who get stuck with all the bad luck?

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.
