Topic: [std-proposals] [c++std-core-27195] An


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 5 Mar 2015 11:25:18 -0600
Raw View
--089e0122ed8a77f39405108ddcef
Content-Type: text/plain; charset=UTF-8

On 5 March 2015 at 11:11, 'Geoffrey Romer' via ISO C++ Standard - Future
Proposals <std-proposals@isocpp.org> wrote:

>
> This doesn't convey any useful information:
>>
>> template<typename T>
>>   void frob(T);
>>
>
> I don't agree; it tells me that frob is a generic operation that works
> with roughly any type T.
>

But what does that mean?  Sure, I can copy/move it (since it was passed by
value), but any other constraints will be dictated by the body of frob.


>
>
>> so in terms of describing the interface it's no different when written
>> like this:
>>
>> void frob(auto);
>>
>
> This is different because now I don't know anything about the requirements
> or semantics of the parameter type.
>

I'm just not seeing how that is any different (other than the incredibly
minor of having to call decltype on its parameter to get its type).

Do you have an example function body that works with frob(T) but doesn't
work with frob(auto) (or vice versa) for a specific concrete type?  I'm
really trying to understand the difference you see between these two forms.
--
 Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404

--

---
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/.

--089e0122ed8a77f39405108ddcef
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 5 March 2015 at 11:11, &#39;Geoffrey Romer&#39; via ISO=
 C++ Standard - Future Proposals <span dir=3D"ltr">&lt;<a href=3D"mailto:st=
d-proposals@isocpp.org" target=3D"_blank">std-proposals@isocpp.org</a>&gt;<=
/span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_extra"><br>=
<div class=3D"gmail_quote"><span class=3D""><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
This doesn&#39;t convey any useful information:<br>
<br>
template&lt;typename T&gt;<br>
=C2=A0 void frob(T);<br></blockquote><div><br></div></span><div>I don&#39;t=
 agree; it tells me that frob is a generic operation that works with roughl=
y any type T.</div></div></div></div></blockquote><div><br></div><div>But w=
hat does that mean?=C2=A0 Sure, I can copy/move it (since it was passed by =
value), but any other constraints will be dictated by the body of frob.</di=
v><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 =
..8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div cla=
ss=3D"gmail_extra"><div class=3D"gmail_quote"><span class=3D""><div>=C2=A0<=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex">so in terms of describing the interface=
 it&#39;s no different when written<br>
like this:<br>
<br>
void frob(auto);<br></blockquote><div><br></div></span><div>This is differe=
nt because now I don&#39;t know anything about the requirements or semantic=
s of the parameter type.</div></div></div></div></blockquote><div><br></div=
><div>I&#39;m just not seeing how that is any different (other than the inc=
redibly minor of having to call decltype on its parameter to get its type).=
</div><div><br></div><div>Do you have an example function body that works w=
ith frob(T) but doesn&#39;t work with frob(auto) (or vice versa) for a spec=
ific concrete type?=C2=A0 I&#39;m really trying to understand the differenc=
e you see between these two forms.</div></div>-- <br><div class=3D"gmail_si=
gnature">=C2=A0Nevin &quot;:-)&quot; Liber=C2=A0 &lt;mailto:<a href=3D"mail=
to:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>&gt;=
=C2=A0 (847) 691-1404</div>
</div></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 />

--089e0122ed8a77f39405108ddcef--

.