220 16790 <6ffb46f5-e2ef-4ebe-b304-2e10a4fd6cbd@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Scott Prager <splinterofchaos@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.general,gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: [c++std-core-27199] Re: [std-proposals] Re:
 Re: An implementation of enhanced auto deduction and abbreviated template
 syntax using Clang
Date: Thu, 5 Mar 2015 17:22:10 -0800 (PST)
Lines: 295
Approved: news@gmane.org
Message-ID: <6ffb46f5-e2ef-4ebe-b304-2e10a4fd6cbd@isocpp.org>
References: <CABsSThrwV0UCbrmoxoeQUskOjvF2+RX5ctpSq3dPMPxm=t6mww@mail.gmail.com>
 <7c7d06ea-1e25-4720-9486-ec068b514ea6@isocpp.org>
 <CA+cyFgvMsbM0Tczjvy=dkJ1SpgtMNtjZtxzOxH8+N8QxuyzwEw@mail.gmail.com>
 <CAJcCCPPqBt1iO3g_unhVPATT6cemOikVWzDVmsEL9dFLnmRMCA@mail.gmail.com>
 <CA+cyFgt-JvWDJTwgUvS8qz-yXPshQKwntLjXPY=tBfNec8GkfQ@mail.gmail.com>
 <CAGg_6+NiuSQMO1RHNJJc=-jK-qC75+K+=GgCg8z35O_EUZJ3=Q@mail.gmail.com>
 <CA+cyFgvUX2wwGUF4rXgD7+ZB1uBG5A6rwTV0uAof9nAbAoNQXw@mail.gmail.com>
 <CAFk2RUb8FJjiwNQSwb-Rm0O4w942GTRqgUALB+p9L1bjtY+ccQ@mail.gmail.com>
 <322c42f4-8a77-4d25-8874-029666dc29d9@isocpp.org>
 <CAFk2RUZhK=400PRJ60T_5Jri8GixwpZLf55swr2qvrY1XDfzZQ@mail.gmail.com>
Reply-To: std-discussion@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_107_606478886.1425604930611"
X-Trace: ger.gmane.org 1425604933 18799 80.91.229.3 (6 Mar 2015 01:22:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 6 Mar 2015 01:22:13 +0000 (UTC)
Cc: std-proposals@isocpp.org, faisalv@gmail.com
To: std-discussion@isocpp.org
Original-X-From: std-discussion+bncBCU6PTE6UUGBBQ4C4STQKGQEIVFYCRQ@isocpp.org Fri Mar 06 02:22:13 2015
Return-path: <std-discussion+bncBCU6PTE6UUGBBQ4C4STQKGQEIVFYCRQ@isocpp.org>
Envelope-to: gclcig-std-discussion@m.gmane.org
Original-Received: from mail-qg0-f72.google.com ([209.85.192.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-discussion+bncBCU6PTE6UUGBBQ4C4STQKGQEIVFYCRQ@isocpp.org>)
	id 1YTgxw-0001bG-6j
	for gclcig-std-discussion@m.gmane.org; Fri, 06 Mar 2015 02:22:12 +0100
Original-Received: by qgdq107 with SMTP id q107sf32117299qgd.3
        for <gclcig-std-discussion@m.gmane.org>; Thu, 05 Mar 2015 17:22:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:content-type:x-original-sender:reply-to:precedence
         :mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=qoMDTjLqYXdqv80zTB8Zk1SRcNvk8n9n7hJd/dedIdU=;
        b=mbF22lVbvJjCX7DLNr2ReOQpZD0xG4syrm4w2FBdXWV0yY01j9RH34u6woZO3v8mUN
         vf/xCgUqpoMvEnUuULb4u+1QXcS0slm4R+npQra3FBai+/j7lEoCQDRhkYldqsDyO+K6
         RsrfN2qemSzPuOe1RvfDvKqddd5vBk1IjjjW9DkraVZG3RxqzFL0XdwpeyW7i6QHNGL7
         elGh9Ql6wn4H2PXPTaVJRMYxxiz6aWHL0ZHNd/jLHIEy8SIaRu2n40AwfJbU+aFhU0OV
         Hw7dQEJCpcQOoF1/VsHqVlrI+JlXWg230qh4PP1CQGVjCcTtWyrzebt1YA3M/0fsjPdw
         H8rQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:content-type:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=qoMDTjLqYXdqv80zTB8Zk1SRcNvk8n9n7hJd/dedIdU=;
        b=P0oQMC+elhXmfOXn0arKXHmshYhOD1sjP9PVU6mGnWndzfgh1fo+kpOPS+Rtm7erIK
         0JHxy/0LmGhxYbQ0GwQfnk6/2SRYaJcAh7L4KKWiPoWcsV+rSCRwQWNhFdedJ+eqxYPc
         /g/lKRlTZIKL9ZcMR2Zx7wioWgLcp7cgIb1EoS570VssrwQr2AbontLL1aSD1+9Q0s3+
         dllcU3ltHxSgsE9DULAUfHv4yQ/nAQfaJovvYKpHPDjtUEpY3aLEgrwPBrbCLBoSCaV4
         4/guWlvT2sbUcLwpmMiB3rahrfdOyHPva3+WmPkKhyGQCJw5cEIPONP0RtFCCNPN6ziI
         G7NQ==
X-Gm-Message-State: ALoCoQkJFZJPZML/HU4lzpS5Tt++55T3x1X/7JQFBvxMaWGBLzhlSbLiWY3O4IIs+3S/Eaqre1uV
X-Received: by 10.236.42.228 with SMTP id j64mr12587927yhb.36.1425604931330;
        Thu, 05 Mar 2015 17:22:11 -0800 (PST)
X-BeenThere: std-discussion@isocpp.org
Original-Received: by 10.140.104.241 with SMTP id a104ls105259qgf.11.gmail; Thu, 05 Mar
 2015 17:22:10 -0800 (PST)
X-Received: by 10.140.36.134 with SMTP id p6mr221552qgp.26.1425604930858;
        Thu, 05 Mar 2015 17:22:10 -0800 (PST)
In-Reply-To: <CAFk2RUZhK=400PRJ60T_5Jri8GixwpZLf55swr2qvrY1XDfzZQ@mail.gmail.com>
X-Original-Sender: SplinterOfChaos@gmail.com
Precedence: list
Mailing-list: list std-discussion@isocpp.org; contact std-discussion+owners@isocpp.org
List-ID: <std-discussion.isocpp.org>
X-Google-Group-Id: 495566654649
List-Post: <http://groups.google.com/a/isocpp.org/group/std-discussion/post>, <mailto:std-discussion@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-discussion+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-discussion/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-discussion/subscribe>,
 <mailto:std-discussion+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+495566654649+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-discussion/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.general:4996 gmane.comp.lang.c++.isocpp.proposals:16790
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.general/4996>

------=_Part_107_606478886.1425604930611
Content-Type: multipart/alternative; 
	boundary="----=_Part_108_1133248340.1425604930611"

------=_Part_108_1133248340.1425604930611
Content-Type: text/plain; charset=UTF-8

I can see where a lot of discomfort might come, here... 

*(1) *Just plain auto seems imprecise and it makes template functions look 
like
non-template functions.

*(2) *Named template parameters seem to provide comparatively more 
information.

For *(1)*, this seems like a special case. When you consider inlining, 
changing
functions that take reference parameters of basic types to pass by value, 
and
other such optimizations our compilers perform, functions have never really
been the concrete entities we like to think of them as. I don't see a need 
to
distinguish between template and non-template functions from a user
point-of-view, except when using *extern "C"*.

*(2)*: As mentioned, one can always fall back on normal template syntax, but
also, I don't know about anyone else, but I tend to name my types verbosely,
and my variables tersely. So I'll write...

template<class Sequence, class UnaryFunction>
void for_each(Sequence& seq, UnaryFunction f) { for(auto&& x : seq) f(x); }


....but with auto as the parameter type, I would reverse this trend:

void for_each(auto& sequence, auto unary_op) { for(auto&& x : sequence) 
unary_op(x); }

....and I think that reads better.

Another reason I think we should embrace this: It brings template code 
within
reach of absolute beginners, both to C++ and programming in general. Trying 
to
teach an initiate what this means...

template<typename Function, typename Value>
auto f(Function fn, Value v) { return fn(v); }

requires teaching the meaning on "*typename*" (because the user may not have
needed typedefs or type aliases at this point), *template<...>*, how "
*Function*"
and "*Value*" do not denote real types, etc., etc.. But explaining this...

auto f(auto fn, auto val) { return fn(val); }

....well, they probably already are familiar with *auto*, using *auto* as a
parameter is intuitive, and those familiar with dynamic languages will feel
right at home, while benefiting from static typing.

On Thursday, March 5, 2015 at 6:52:40 PM UTC-5, Ville Voutilainen wrote:
>
> On 6 March 2015 at 01:43, Matthew Fioravante <fmatth...@gmail.com 
> <javascript:>> wrote: 
> >> void frob(auto t) 
> >> { 
> >>     // if I want to use 'T' here, I need to do a decltype(t) to get at 
> it 
> >> } 
> > You may need remove pointer, ref, and/or cv qualifiers if you use auto*, 
> > auto&& (perfect forwarding), const auto&, etc.. using type_traits. If 
> the 
> > signature changes, you'll have to remember to fix the traits you used. 
>
> Yes. Not that the "signature changes" is all that much different from an 
> old-skool template. 
>
> > If your implementation needs to express type T, it might be better to 
> use 
> > the old template syntax. 
>
> Perhaps so. That may be a fairly big "if". 
>

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+unsubscribe@isocpp.org.
To post to this group, send email to std-discussion@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-discussion/.

------=_Part_108_1133248340.1425604930611
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I can see where a lot of discomfort might come, here.=
...&nbsp;</div><div><br></div><div><b>(1) </b>Just plain auto seems imprecis=
e and it makes template functions look like</div><div>non-template function=
s.</div><div><br></div><div><b>(2) </b>Named template parameters seem to pr=
ovide comparatively more information.</div><div><br></div><div>For <b>(1)</=
b>, this seems like a special case. When you consider inlining, changing</d=
iv><div>functions that take reference parameters of basic types to pass by =
value, and</div><div>other such optimizations our compilers perform, functi=
ons have never really</div><div>been the concrete entities we like to think=
 of them as. I don't see a need to</div><div>distinguish between template a=
nd non-template functions from a user</div><div>point-of-view, except when =
using <i>extern "C"</i>.</div><div><br></div><div><b>(2)</b>: As mentioned,=
 one can always fall back on normal template syntax, but</div><div>also, I =
don't know about anyone else, but I tend to name my types verbosely,</div><=
div>and my variables tersely. So I'll write...</div><div><br></div><div cla=
ss=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap=
: break-word; background-color: rgb(250, 250, 250);"><code class=3D"prettyp=
rint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">template</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">class</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Seq=
uence</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">class</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #606;" class=3D"styled-by-prettify">UnaryFunction</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> for_each</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #606;" class=3D"style=
d-by-prettify">Sequence</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> seq</span><span 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: #606;" class=3D"styled-by-prettify">UnaryFunction</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</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"> </span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">for</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">(</span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">auto</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&a=
mp;&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> x=
 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> seq</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> f</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">x</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">}=
</span></div></code></div><div><br></div><div><br></div><div>...but with au=
to as the parameter type, I would reverse this trend:</div><div><br></div><=
div><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187=
); word-wrap: break-word; background-color: rgb(250, 250, 250);"><code clas=
s=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;=
" class=3D"styled-by-prettify">void</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> for_each</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">auto</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> sequence</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> unary_op</span><span=
 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;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"sty=
led-by-prettify">for</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>auto</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;=
&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> x </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> sequence</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> unary_op</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">x</span><span style=3D"color: #660;" clas=
s=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></div></code></div><br></div><div>...and I think that reads=
 better.</div><div><br></div><div>Another reason I think we should embrace =
this: It brings template code within</div><div>reach of absolute beginners,=
 both to C++ and programming in general. Trying to</div><div>teach an initi=
ate what this means...</div><div><br></div><div class=3D"prettyprint" style=
=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; background=
-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"subp=
rettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">templ=
ate</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">typename</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"color: #606;" class=3D"styled-by-prettify">Function</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">typename</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"=
styled-by-prettify">Value</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&gt;</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"> f<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an style=3D"color: #606;" class=3D"styled-by-prettify">Function</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> fn</span><span 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: #606;" =
class=3D"styled-by-prettify">Value</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> v</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </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: #008;" class=3D"styled-by-prettify">return</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> fn</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">v</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">);</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></div></code></div><div><br></div><div>requires teaching t=
he meaning on "<i>typename</i>" (because the user may not have</div><div>ne=
eded typedefs or type aliases at this point), <i>template&lt;...&gt;</i>, h=
ow "<i>Function</i>"</div><div>and "<i>Value</i>" do not denote real types,=
 etc., etc.. But explaining this...</div><div><br></div><div><div class=3D"=
prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: brea=
k-word; background-color: rgb(250, 250, 250);"><code class=3D"prettyprint">=
<div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-=
by-prettify">auto</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> f</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(=
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> fn</span><span =
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: #0=
08;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> val</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #008;" class=3D"styled-by-prettify">return</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> fn</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">val</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">}</span></div></code></div></div><div><br></div><div>...=
well, they probably already are familiar with <i>auto</i>, using <i>auto</i=
> as a</div><div>parameter is intuitive, and those familiar with dynamic la=
nguages will feel</div><div>right at home, while benefiting from static typ=
ing.<br></div><br>On Thursday, March 5, 2015 at 6:52:40 PM UTC-5, Ville Vou=
tilainen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 6 March 2015=
 at 01:43, Matthew Fioravante &lt;<a href=3D"javascript:" target=3D"_blank"=
 gdf-obfuscated-mailto=3D"DORbBlHhyyoJ" rel=3D"nofollow" onmousedown=3D"thi=
s.href=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:';r=
eturn true;">fmatth...@gmail.com</a>&gt; wrote:
<br>&gt;&gt; void frob(auto t)
<br>&gt;&gt; {
<br>&gt;&gt; &nbsp; &nbsp; // if I want to use 'T' here, I need to do a dec=
ltype(t) to get at it
<br>&gt;&gt; }
<br>&gt; You may need remove pointer, ref, and/or cv qualifiers if you use =
auto*,
<br>&gt; auto&amp;&amp; (perfect forwarding), const auto&amp;, etc.. using =
type_traits. If the
<br>&gt; signature changes, you'll have to remember to fix the traits you u=
sed.
<br>
<br>Yes. Not that the "signature changes" is all that much different from a=
n
<br>old-skool template.
<br>
<br>&gt; If your implementation needs to express type T, it might be better=
 to use
<br>&gt; the old template syntax.
<br>
<br>Perhaps so. That may be a fairly big "if".
<br></blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Discussion&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-discussion+unsubscribe@isocpp.org">std-discus=
sion+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-discussion@isocp=
p.org">std-discussion@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-discussion/">http://groups.google.com/a/isocpp.org/group/std-discussion=
/</a>.<br />

------=_Part_108_1133248340.1425604930611--
------=_Part_107_606478886.1425604930611--

.
