Topic: identity type trait
Author: Matthew Fioravante <fmatthew5876@gmail.com>
Date: Thu, 19 Feb 2015 09:28:20 -0800 (PST)
Raw View
------=_Part_616_942708746.1424366900591
Content-Type: multipart/alternative;
boundary="----=_Part_617_2119030103.1424366900591"
------=_Part_617_2119030103.1424366900591
Content-Type: text/plain; charset=UTF-8
This would be a proposal for the most simple type trait
template <typename T>
struct identity { using type = T; }
template <typename T>
using identity_t = typename identity<T>::type;
One use case for this type trait is to resolve overloading conflicts when
you want overloading to only trigger off of one function parameter.
template <typename T> void p0(vector<T>& v, T value);
template <typename T> void p1(vector<T>& v, identity_t<T> value);
void foo() {
std::vector<string> strings;
p0(strings, "abc"); //Error cannot deduce type T (string vs const char[4])
p1(strings, "abc"); //Ok, T is string
}
--
---
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/.
------=_Part_617_2119030103.1424366900591
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>This would be a proposal for the most simple type tra=
it</div><div> </div><div><div style=3D"border: 1px solid rgb(187, 187,=
187); word-wrap: break-word; background-color: rgb(250, 250, 250);" class=
=3D"prettyprint"><code class=3D"prettyprint"><div class=3D"subprettyprint">=
<font color=3D"#000088"><span style=3D"color: rgb(0, 0, 136);" class=3D"sty=
led-by-prettify">template</span><span style=3D"color: rgb(0, 0, 0);" class=
=3D"styled-by-prettify"> </span><span style=3D"color: rgb(102, 102, 0);" cl=
ass=3D"styled-by-prettify"><</span><span style=3D"color: rgb(0, 0, 136);=
" class=3D"styled-by-prettify">typename</span><span style=3D"color: rgb(0, =
0, 0);" class=3D"styled-by-prettify"> T</span><span style=3D"color: rgb(102=
, 102, 0);" class=3D"styled-by-prettify">></span><span style=3D"color: r=
gb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><span style=3D"color:=
rgb(0, 0, 136);" class=3D"styled-by-prettify">struct</span><span style=3D"=
color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> identity </span><span s=
tyle=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{</span><spa=
n style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span=
style=3D"color: rgb(0, 0, 136);" class=3D"styled-by-prettify">using</span>=
<span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> type </s=
pan><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">=
=3D</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"=
> T</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prett=
ify">;</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-pre=
ttify">}</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-pret=
tify"><br><br></span><span style=3D"color: rgb(0, 0, 136);" class=3D"styled=
-by-prettify">template</span><span style=3D"color: rgb(0, 0, 0);" class=3D"=
styled-by-prettify"> </span><span style=3D"color: rgb(102, 102, 0);" class=
=3D"styled-by-prettify"><</span><span style=3D"color: rgb(0, 0, 136);" c=
lass=3D"styled-by-prettify">typename</span><span style=3D"color: rgb(0, 0, =
0);" class=3D"styled-by-prettify"> T</span><span style=3D"color: rgb(102, 1=
02, 0);" class=3D"styled-by-prettify">></span><span style=3D"color: rgb(=
0, 0, 0);" class=3D"styled-by-prettify"><br></span><span style=3D"color: rg=
b(0, 0, 136);" class=3D"styled-by-prettify">using</span><span style=3D"colo=
r: rgb(0, 0, 0);" class=3D"styled-by-prettify"> identity_t </span><span sty=
le=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">=3D</span><spa=
n style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span=
style=3D"color: rgb(0, 0, 136);" class=3D"styled-by-prettify">typename</sp=
an><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> ident=
ity</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prett=
ify"><</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-pre=
ttify">T</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-=
prettify">>::</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled=
-by-prettify">type</span><span style=3D"color: rgb(102, 102, 0);" class=3D"=
styled-by-prettify">;</span></font></div></code></div><br>One use case for&=
nbsp;this type trait is to resolve overloading conflicts when you want over=
loading to only trigger off of one function parameter.</div><div> </di=
v><div><div style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break=
-word; background-color: rgb(250, 250, 250);" class=3D"prettyprint"><code c=
lass=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: rg=
b(0, 0, 136);" class=3D"styled-by-prettify">template</span><span style=3D"c=
olor: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: rgb(102, 102, 0);" class=3D"styled-by-prettify"><</span><span style=
=3D"color: rgb(0, 0, 136);" class=3D"styled-by-prettify">typename</span><sp=
an style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> T</span><sp=
an style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">></sp=
an><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: rgb(0, 0, 136);" class=3D"styled-by-prettify">void<=
/span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> p0=
</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify=
">(</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"=
>vector</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-p=
rettify"><</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by=
-prettify">T</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled=
-by-prettify">>&</span><span style=3D"color: rgb(0, 0, 0);" class=3D=
"styled-by-prettify"> v</span><span style=3D"color: rgb(102, 102, 0);" clas=
s=3D"styled-by-prettify">,</span><span style=3D"color: rgb(0, 0, 0);" class=
=3D"styled-by-prettify"> T value</span><span style=3D"color: rgb(102, 102, =
0);" class=3D"styled-by-prettify">);</span><span style=3D"color: rgb(0, 0, =
0);" class=3D"styled-by-prettify"><br></span><span style=3D"color: rgb(0, 0=
, 136);" class=3D"styled-by-prettify">template</span><span style=3D"color: =
rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><span style=3D"color: r=
gb(102, 102, 0);" class=3D"styled-by-prettify"><</span><span style=3D"co=
lor: rgb(0, 0, 136);" class=3D"styled-by-prettify">typename</span><span sty=
le=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> T</span><span sty=
le=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">></span><sp=
an style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: rgb(0, 0, 136);" class=3D"styled-by-prettify">void</span>=
<span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> p1</span=
><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">(</s=
pan><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify">vecto=
r</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettif=
y"><</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prett=
ify">T</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-pr=
ettify">>&</span><span style=3D"color: rgb(0, 0, 0);" class=3D"style=
d-by-prettify"> v</span><span style=3D"color: rgb(102, 102, 0);" class=3D"s=
tyled-by-prettify">,</span><span style=3D"color: rgb(0, 0, 0);" class=3D"st=
yled-by-prettify"> identity_t</span><span style=3D"color: rgb(102, 102, 0);=
" class=3D"styled-by-prettify"><</span><span style=3D"color: rgb(0, 0, 0=
);" class=3D"styled-by-prettify">T</span><span style=3D"color: rgb(102, 102=
, 0);" class=3D"styled-by-prettify">></span><span style=3D"color: rgb(0,=
0, 0);" class=3D"styled-by-prettify"> value</span><span style=3D"color: rg=
b(102, 102, 0);" class=3D"styled-by-prettify">);</span><span style=3D"color=
: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br></span><div><span style=
=3D"color: rgb(0, 0, 136);" class=3D"styled-by-prettify">void</span><span s=
tyle=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> foo</span><span=
style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">()</span><=
span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">{</span=
><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br>&nbs=
p; std</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-pr=
ettify">::</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-pr=
ettify">vector</span><span style=3D"color: rgb(0, 136, 0);" class=3D"styled=
-by-prettify"><string></span><span style=3D"color: rgb(0, 0, 0);" cla=
ss=3D"styled-by-prettify"> strings</span><span style=3D"color: rgb(102, 102=
, 0);" class=3D"styled-by-prettify">;</span><span style=3D"color: rgb(0, 0,=
0);" class=3D"styled-by-prettify"><br><br> p0</span><span style=3D"c=
olor: rgb(102, 102, 0);" class=3D"styled-by-prettify">(</span><span style=
=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify">strings</span><span =
style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">,</span><sp=
an style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: rgb(0, 136, 0);" class=3D"styled-by-prettify">"abc"</span=
><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">);</=
span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: rgb(136, 0, 0);" class=3D"styled-by-prettify">//E=
rror cannot deduce type T (string vs const char[4])</span><span style=3D"co=
lor: rgb(0, 0, 0);" class=3D"styled-by-prettify"><br> p1</span><span =
style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">(</span><sp=
an style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify">strings</spa=
n><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-prettify">,</=
span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: rgb(0, 136, 0);" class=3D"styled-by-prettify">"ab=
c"</span><span style=3D"color: rgb(102, 102, 0);" class=3D"styled-by-pretti=
fy">);</span><span style=3D"color: rgb(0, 0, 0);" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: rgb(136, 0, 0);" class=3D"styled-by-prett=
ify">//Ok, T is string</span><span style=3D"color: rgb(0, 0, 0);" class=3D"=
styled-by-prettify"><br></span><span style=3D"color: rgb(102, 102, 0);" cla=
ss=3D"styled-by-prettify">}</span><span style=3D"color: rgb(0, 0, 0);" clas=
s=3D"styled-by-prettify"><br></span></div></div></code></div><br></div></di=
v>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_617_2119030103.1424366900591--
------=_Part_616_942708746.1424366900591--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 19 Feb 2015 19:36:04 +0200
Raw View
On 19 February 2015 at 19:28, Matthew Fioravante <fmatthew5876@gmail.com> wrote:
> This would be a proposal for the most simple type trait
>
> template <typename T>
> struct identity { using type = T; }
>
> template <typename T>
> using identity_t = typename identity<T>::type;
>
> One use case for this type trait is to resolve overloading conflicts when
> you want overloading to only trigger off of one function parameter.
>
> template <typename T> void p0(vector<T>& v, T value);
> template <typename T> void p1(vector<T>& v, identity_t<T> value);
> void foo() {
> std::vector<string> strings;
>
> p0(strings, "abc"); //Error cannot deduce type T (string vs const char[4])
> p1(strings, "abc"); //Ok, T is string
> }
It has been rejected and removed before. See
http://cplusplus.github.io/LWG/lwg-defects.html#939
You can use common_type_t<T, T> for the same effect, I think.
--
---
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/.
.
Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 19 Feb 2015 11:41:04 -0600
Raw View
--001a113a58981c473d050f7473b0
Content-Type: text/plain; charset=UTF-8
On 19 February 2015 at 11:36, Ville Voutilainen <ville.voutilainen@gmail.com
> wrote:
> It has been rejected and removed before. See
>
> http://cplusplus.github.io/LWG/lwg-defects.html#939
>
But since then N3766
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3766.html> was
received favorably in LEWG. I believe the current status is that we are
waiting on an updated paper.
--
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/.
--001a113a58981c473d050f7473b0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
On 19 February 2015 at 11:36, Ville Voutilainen <span dir=3D"ltr"><<a hr=
ef=3D"mailto:ville.voutilainen@gmail.com" target=3D"_blank">ville.voutilain=
en@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(=
204,204,204);border-left-style:solid;padding-left:1ex"><div id=3D":280" cla=
ss=3D"" style=3D"overflow:hidden">It has been rejected and removed before. =
See<br>
<br>
<a href=3D"http://cplusplus.github.io/LWG/lwg-defects.html#939" target=3D"_=
blank">http://cplusplus.github.io/LWG/lwg-defects.html#939</a><br></div></b=
lockquote></div><br>But since then=C2=A0<a href=3D"http://www.open-std.org/=
jtc1/sc22/wg21/docs/papers/2013/n3766.html">N3766</a>=C2=A0was received fav=
orably in LEWG.=C2=A0 I believe the current status is that we are waiting o=
n an updated paper.<br>-- <br><div class=3D"gmail_signature">=C2=A0Nevin &q=
uot;:-)" Liber=C2=A0 <mailto:<a href=3D"mailto:nevin@eviloverlord.c=
om" target=3D"_blank">nevin@eviloverlord.com</a>>=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 - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a113a58981c473d050f7473b0--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 19 Feb 2015 19:44:24 +0200
Raw View
On 19 February 2015 at 19:41, Nevin Liber <nevin@eviloverlord.com> wrote:
>
> On 19 February 2015 at 11:36, Ville Voutilainen
> <ville.voutilainen@gmail.com> wrote:
>>
>> It has been rejected and removed before. See
>>
>> http://cplusplus.github.io/LWG/lwg-defects.html#939
>
>
> But since then N3766 was received favorably in LEWG. I believe the current
> status is that we are waiting on an updated paper.
Cool, thanks for the update.
--
---
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/.
.
Author: "'Jeffrey Yasskin' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Thu, 19 Feb 2015 10:33:45 -0800
Raw View
--089e0158a8c8469dca050f752e12
Content-Type: text/plain; charset=UTF-8
Yep. Its author is a slacker and would appreciate someone else taking over
the update. LEWG's comments are at
http://wiki.edg.com/twiki/bin/view/Wg21chicago2013/N3766.
On Thu, Feb 19, 2015 at 9:41 AM, Nevin Liber <nevin@eviloverlord.com> wrote:
>
> On 19 February 2015 at 11:36, Ville Voutilainen <
> ville.voutilainen@gmail.com> wrote:
>
>> It has been rejected and removed before. See
>>
>> http://cplusplus.github.io/LWG/lwg-defects.html#939
>>
>
> But since then N3766
> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3766.html> was
> received favorably in LEWG. I believe the current status is that we are
> waiting on an updated paper.
> --
> 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/.
>
--
---
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/.
--089e0158a8c8469dca050f752e12
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Yep. Its author is a slacker and would appreciate someone =
else taking over the update. LEWG's comments are at=C2=A0<a href=3D"htt=
p://wiki.edg.com/twiki/bin/view/Wg21chicago2013/N3766">http://wiki.edg.com/=
twiki/bin/view/Wg21chicago2013/N3766</a>.</div><div class=3D"gmail_extra"><=
br><div class=3D"gmail_quote">On Thu, Feb 19, 2015 at 9:41 AM, Nevin Liber =
<span dir=3D"ltr"><<a href=3D"mailto:nevin@eviloverlord.com" target=3D"_=
blank">nevin@eviloverlord.com</a>></span> wrote:<br><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 class=3D"gmail_extra"><span class=3D""><br=
><div class=3D"gmail_quote">On 19 February 2015 at 11:36, Ville Voutilainen=
<span dir=3D"ltr"><<a href=3D"mailto:ville.voutilainen@gmail.com" targe=
t=3D"_blank">ville.voutilainen@gmail.com</a>></span> wrote:<br><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-widt=
h:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-le=
ft:1ex"><div style=3D"overflow:hidden">It has been rejected and removed bef=
ore. See<br>
<br>
<a href=3D"http://cplusplus.github.io/LWG/lwg-defects.html#939" target=3D"_=
blank">http://cplusplus.github.io/LWG/lwg-defects.html#939</a><br></div></b=
lockquote></div><br></span>But since then=C2=A0<a href=3D"http://www.open-s=
td.org/jtc1/sc22/wg21/docs/papers/2013/n3766.html" target=3D"_blank">N3766<=
/a>=C2=A0was received favorably in LEWG.=C2=A0 I believe the current status=
is that we are waiting on an updated paper.<span class=3D"HOEnZb"><font co=
lor=3D"#888888"><br>-- <br><div>=C2=A0Nevin ":-)" Liber=C2=A0 <=
;mailto:<a href=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@e=
viloverlord.com</a>>=C2=A0 <a href=3D"tel:%28847%29%20691-1404" value=3D=
"+18476911404" target=3D"_blank">(847) 691-1404</a></div>
</font></span></div></div><div class=3D"HOEnZb"><div class=3D"h5">
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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@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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--089e0158a8c8469dca050f752e12--
.
Author: Zhihao Yuan <zy@miator.net>
Date: Thu, 19 Feb 2015 14:56:49 -0500
Raw View
On Thu, Feb 19, 2015 at 12:41 PM, Nevin Liber <nevin@eviloverlord.com> wrote:
>
> But since then N3766 was received favorably in LEWG. I believe the current
> status is that we are waiting on an updated paper.
But no "favorability" between the two options was not given.
I'm in favor of `identity_of` since I see motivation to rename,
but don't see motivation to standardize SGI `identity`.
Of course `identity_of_t` is bad, but I don't mind to just call
it `identity_t`. Breaking naming consistency a little bit is
worthy here from my point of view.
--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://bit.ly/blog4bsd
--
---
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/.
.
Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Thu, 19 Feb 2015 23:35:13 +0100
Raw View
This is a multi-part message in MIME format.
--------------040600090009080707000003
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Le 19/02/15 19:33, 'Jeffrey Yasskin' via ISO C++ Standard - Future=20
Proposals a =C3=A9crit :
> Yep. Its author is a slacker and would appreciate someone else taking=20
> over the update. LEWG's comments are at=20
> http://wiki.edg.com/twiki/bin/view/Wg21chicago2013/N3766.
>
I missed this proposal.
IMHO, we have several kind of identity *functions*:
A * tag type - id<T>
template<class T>
struct id {};
Can be used to overload on the function result
M1 f(id<M1>, X);
M2 f(id<M2>, X);
B * meta-function - id<T>::type
template<class T>
struct id {
uisng type =3D T,
};
used to omit from deduction
M f(M, id<T>::type);
and also as type trait definition
template<class T>
struct is_trait : id<TT<T>> {};
C * alias meta-function - id_t<T>
template <class T>
using id_t =3D typename id<T>::type;
A shortcut
D * meta-function class (type constructor) - id::apply<T>
struct id {
template <class T>
using apply =3D id_t<T>;
};
E * function object - id_c<T>{}(x), id<T>(x)
template <class U>
struct id_c {
template <class T> // requires ???(T,U)
T&& operator()(T&&) const;
};
template <class T>
constexpr id_c<T> id =3D {};
F * polymorphic function object - id_c{}(x), id{}(x)
struct id_c {
template <class T>
T&& operator()(T&&) const;
};
constexpr id_c id =3D {};
G * polymorphic lambda - id(x)
auto id =3D [](auto&& x) { return x; }
Just wondering which identity classes/functions we want to standardize.
F seems more general than G as it is a id constexpr.
With an eval helper
template <class T>
using eval =3D typename T::type;
use case C id_t<T> is equivalent to eval<id, T>
With a quote helper
template <template <class ...> class TC>
struct quote {
template <class ... Ts>
using apply =3D TC<Ts...>;
};
use case D id::apply is equivalent to quote<id>
Vicente
--=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/.
--------------040600090009080707000003
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
<div class=3D"moz-cite-prefix">Le 19/02/15 19:33, 'Jeffrey Yasskin'
via ISO C++ Standard - Future Proposals a =C3=A9crit=C2=A0:<br>
</div>
<blockquote
cite=3D"mid:CANh-dXnNCjo7aNYB88h07t33FqyijsHSPD+=3DLxvi96+Hgtw4Sg@mail.gmai=
l.com"
type=3D"cite">
<div dir=3D"ltr">Yep. Its author is a slacker and would appreciate
someone else taking over the update. LEWG's comments are at=C2=A0<a
moz-do-not-send=3D"true"
href=3D"http://wiki.edg.com/twiki/bin/view/Wg21chicago2013/N3766"=
>http://wiki.edg.com/twiki/bin/view/Wg21chicago2013/N3766</a>.</div>
<div class=3D"gmail_extra"><br>
</div>
</blockquote>
<font size=3D"+1"><br>
I missed this proposal.<br>
IMHO, we have several kind of identity <b>functions</b>:<br>
<br>
A * tag type - id<T><br>
<br>
</font><br>
<font size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D"+1"=
><font
size=3D"+1"><font size=3D"+1">template<class T><br>
struct id=C2=A0 {};<br>
<br>
</font></font></font></font></font></font><font size=3D"+1"><=
font
size=3D"+1">Can be used to overload on the </font></font><font
size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D"+1">
function </font></font>result <br>
<br>
</font>M1 f(id<M1>, X);<br>
</font><font size=3D"+1"><font size=3D"+1">M2 f(id<M2>, X);<br>
</font></font><font size=3D"+1"><font size=3D"+1"><br>
</font>B * meta-function -=C2=A0</font><font size=3D"+1">=C2=A0
id<T>::type <br>
</font><br>
<font size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D"+1"=
><font
size=3D"+1"><font size=3D"+1">template<class T><br>
struct id=C2=A0 {<br>
=C2=A0 uisng type=C2=A0 =3D T,<br>
};<br>
</font></font></font></font></font></font><br>
<font size=3D"+1">used to omit from deduction<br>
<br>
</font><font size=3D"+1"><font size=3D"+1"><font size=3D"+1">M f(M,
id<T>::type);<br>
</font></font></font><br>
<font size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D"+1"=
><font
size=3D"+1">and also as type trait definition<br>
</font></font><br>
<font size=3D"+1"><font size=3D"+1"><font size=3D"+1">template<=
;class
T><br>
struct is_trait : id<TT<T>> {};<br>
<br>
</font></font></font></font></font></font><font size=3D"+1">C
* alias meta-function - id_t<T><br>
</font><br>
<font size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D"+1"=
><font
size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D=
"+1"><font
size=3D"+1"><font size=3D"+1">
=C2=A0 template <class T><br>
=C2=A0 using id_t =3D typename id<T>::type;<b=
r>
</font></font></font></font></font></font></font></fo=
nt></font></font><br>
A shortcut <br>
<br>
<font size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D"+1"=
><font
size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D=
"+1">D
* meta-function class (type constructor) -
id::apply<T><br>
</font></font></font></font></font></font></font></font><=
br>
<font size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D"+1"=
><font
size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D=
"+1"><font
size=3D"+1"><font size=3D"+1">struct id {<br>
=C2=A0 template <class T><br>
=C2=A0 using apply =3D id_t<T>;<br>
};<br>
<br>
</font></font></font></font></font></font></font></fo=
nt></font>E
* function object - id_c<T>{}(x), id<T>(x)<br>
</font><br>
<font size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D"+1"=
>template
<class U><br>
</font></font>struct id_c {<br>
=C2=A0 template <class T> // requires ???(T,U)<br>
=C2=A0 T&& operator()(T&&) const;<br>
};<br>
<br>
</font></font>template <class T><br>
<font size=3D"+1"><font size=3D"+1"><font size=3D"+1">constexpr
id_c<T> id =3D {};<br>
<br>
</font></font>F * polymorphic function object - id_c{}(x), </font><=
font
size=3D"+1"><font size=3D"+1">id{}(x)</font><br>
struct id_c {<br>
=C2=A0 template <class T><br>
=C2=A0 T&& operator()(T&&) </font><font size=3D"+1"><=
font
size=3D"+1"><font size=3D"+1">const</font></font>;<br>
};<br>
<br>
constexpr id_c id =3D {};<br>
<br>
G * polymorphic lambda - id(x)<br>
<br>
auto id =3D [](auto&& x) { return x; }<br>
<br>
Just wondering which identity classes/functions we want to
standardize.=C2=A0 <br>
<br>
F seems more general than G as it is a id constexpr.<br>
<br>
With an eval helper<br>
<br>
template <class T><br>
using eval =3D typename T::type;<br>
<br>
use case C id_t<T> is equivalent to eval<id, T><br>
<br>
</font><font size=3D"+1"><font size=3D"+1">With a quote helper<br>
</font><br>
template <template <class ...> class TC><br>
struct quote {<br>
=C2=A0 template <class ... Ts><br>
=C2=A0 using apply =3D TC<Ts...>;<br>
};<br>
</font><br>
<font size=3D"+1"><font size=3D"+1">use case D </font></font><font
size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D"+1"><fo=
nt
size=3D"+1"><font size=3D"+1"><font size=3D"+1"><font size=3D=
"+1"><font
size=3D"+1"><font size=3D"+1">id::apply</font></font>=
</font></font></font></font></font></font>
is equivalent to quote<id><br>
</font><br>
Vicente</font>
</body>
</html>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--------------040600090009080707000003--
.
Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
Date: Thu, 19 Feb 2015 19:15:29 -0800 (PST)
Raw View
------=_Part_242_780902529.1424402129878
Content-Type: multipart/alternative;
boundary="----=_Part_243_60046388.1424402129882"
------=_Part_243_60046388.1424402129882
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Thursday, February 19, 2015 at 10:34:06 AM UTC-8, Jeffrey Yasskin wrote:
>
> On Thu, Feb 19, 2015 at 9:41 AM, Nevin Liber <ne...@eviloverlord.com>
> wrote:
>
>>
>> But since then N3766=20
>> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3766.html> was=
=20
>> received favorably in LEWG. I believe the current status is that we are=
=20
>> waiting on an updated paper.=20
>>
>
> Yep. Its author is a slacker and would appreciate someone else taking ove=
r=20
> the update. LEWG's comments are at=20
> http://wiki.edg.com/twiki/bin/view/Wg21chicago2013/N3766=20
> <http://www.google.com/url?q=3Dhttp%3A%2F%2Fwiki.edg.com%2Ftwiki%2Fbin%2F=
view%2FWg21chicago2013%2FN3766&sa=3DD&sntz=3D1&usg=3DAFQjCNGPTsoRJXd2vNhBEg=
twRGi43HXhNw>
> .
>
wiki.edg.com requires a login and password in order to view pages, and when=
=20
I try to create a login via
http://wiki.edg.com/twiki/bin/view/TWiki/TWikiRegistration
it sends me to a "403 Forbidden" page at
http://wiki.edg.com/twiki/bin/register/Main/WebHome
So I can't see the LEWG comments.
But if I could see them, I'd be happy to update the proposal accordingly.
(My personal view so far is that identity<T>::operator() shouldn't exist;=
=20
just identity<T>::type and its alias identity_t<T>. But I wonder what=20
LEWG's view was.)
=E2=80=93Arthur
--=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/.
------=_Part_243_60046388.1424402129882
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Thursday, February 19, 2015 at 10:34:06 AM UTC-8, Jeffr=
ey Yasskin wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px=
0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); =
border-left-style: solid; padding-left: 1ex;"><div dir=3D"ltr">On Thu, Feb =
19, 2015 at 9:41 AM, Nevin Liber <span dir=3D"ltr"><<a target=3D"_b=
lank" gdf-obfuscated-mailto=3D"-gMBp4OzDckJ" rel=3D"nofollow" style=3D"colo=
r: rgb(102, 17, 204);">ne...@eviloverlord.com</a>></span> wrote:<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex=
; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-lef=
t-style: solid; padding-left: 1ex;"><div dir=3D"ltr"><br></div></blockquote=
></blockquote><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0p=
x 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); bor=
der-left-style: solid; padding-left: 1ex;"><blockquote class=3D"gmail_quote=
" style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-c=
olor: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><di=
v dir=3D"ltr">But since then <a href=3D"http://www.open-std.org/jtc1/s=
c22/wg21/docs/papers/2013/n3766.html" target=3D"_blank" rel=3D"nofollow">N3=
766</a> was received favorably in LEWG. I believe the current st=
atus is that we are waiting on an updated paper. </div></blockquote></=
blockquote><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0=
..8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border=
-left-style: solid; padding-left: 1ex;"><div dir=3D"ltr"><br></div></blockq=
uote><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; =
border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-=
style: solid; padding-left: 1ex;"><div dir=3D"ltr">Yep. Its author is a sla=
cker and would appreciate someone else taking over the update. LEWG's comme=
nts are at <a href=3D"http://www.google.com/url?q=3Dhttp%3A%2F%2Fwiki.=
edg.com%2Ftwiki%2Fbin%2Fview%2FWg21chicago2013%2FN3766&sa=3DD&sntz=
=3D1&usg=3DAFQjCNGPTsoRJXd2vNhBEgtwRGi43HXhNw" target=3D"_blank" rel=3D=
"nofollow">http://wiki.edg.com/twiki/<wbr>bin/view/Wg21chicago2013/N3766</a=
><wbr>.</div></blockquote><div><br></div>wiki.edg.com requires a login and =
password in order to view pages, and when I try to create a login via<div>h=
ttp://wiki.edg.com/twiki/bin/view/TWiki/TWikiRegistration</div><div>it send=
s me to a "403 Forbidden" page at</div><div>http://wiki.edg.com/twiki/bin/r=
egister/Main/WebHome</div><div>So I can't see the LEWG comments.</div><div>=
<br></div><div>But if I could see them, I'd be happy to update the proposal=
accordingly.</div><div><br></div><div>(My personal view so far is that&nbs=
p;<span style=3D"color: rgb(0, 0, 0); font-family: monospace; font-size: me=
dium; white-space: nowrap;">identity<T>::operator()</span> shouldn't =
exist; just <font face=3D"courier new, monospace">identity<T>::type</=
font> and its alias <font face=3D"courier new, monospace">identity_t<T&g=
t;</font>. But I wonder what LEWG's view was.)</div><div><br></div><div>=E2=
=80=93Arthur<br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_243_60046388.1424402129882--
------=_Part_242_780902529.1424402129878--
.
Author: Zhihao Yuan <zy@miator.net>
Date: Thu, 19 Feb 2015 23:25:45 -0500
Raw View
On Thu, Feb 19, 2015 at 10:15 PM, Arthur O'Dwyer
<arthur.j.odwyer@gmail.com> wrote:
>
> wiki.edg.com requires a login and password in order to view pages, and when
> I try to create a login via
> http://wiki.edg.com/twiki/bin/view/TWiki/TWikiRegistration
> it sends me to a "403 Forbidden" page at
> http://wiki.edg.com/twiki/bin/register/Main/WebHome
> So I can't see the LEWG comments.
>
> But if I could see them, I'd be happy to update the proposal accordingly.
Write a new one, bring it to Lenexa meeting, and
you will get the access.
>
> (My personal view so far is that identity<T>::operator() shouldn't exist;
> just identity<T>::type and its alias identity_t<T>. But I wonder what LEWG's
> view was.)
>
LEWG spent some time on discussing how to make
the operator() work in Chicago, including constraining
the template and choosing the header file choice, but
no poll was taken to show which approach is favored.
If you want to champion one approach, please provide
the reason in your paper.
Also, if you want to use the name `identity`, you need
a survey on existing implementations to see whether
the old SGI `identity` is still in use, etc.
--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://bit.ly/blog4bsd
--
---
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/.
.
Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Sun, 22 Feb 2015 10:42:19 +0100
Raw View
This is a multi-part message in MIME format.
--------------060900030605030103010902
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Le 20/02/15 05:25, Zhihao Yuan a =C3=A9crit :
> On Thu, Feb 19, 2015 at 10:15 PM, Arthur O'Dwyer
> <arthur.j.odwyer@gmail.com> wrote:
>> wiki.edg.com requires a login and password in order to view pages, and w=
hen
>> I try to create a login via
>> http://wiki.edg.com/twiki/bin/view/TWiki/TWikiRegistration
>> it sends me to a "403 Forbidden" page at
>> http://wiki.edg.com/twiki/bin/register/Main/WebHome
>> So I can't see the LEWG comments.
>>
>> But if I could see them, I'd be happy to update the proposal accordingly=
..
> Write a new one, bring it to Lenexa meeting, and
> you will get the access.
>
>> (My personal view so far is that identity<T>::operator() shouldn't exist=
;
>> just identity<T>::type and its alias identity_t<T>. But I wonder what LE=
WG's
>> view was.)
>>
> LEWG spent some time on discussing how to make
> the operator() work in Chicago, including constraining
> the template and choosing the header file choice, but
> no poll was taken to show which approach is favored.
> If you want to champion one approach, please provide
> the reason in your paper.
>
> Also, if you want to use the name `identity`, you need
> a survey on existing implementations to see whether
> the old SGI `identity` is still in use, etc.
>
I propose
* to use id instead of identity to avoid the backward compatibility=20
constraint and
* to remove the operator() from id<T> as it is not really needed, id<>{}=20
is the identity function object.
Would the following be less controversial
template <class T=3Dvoid>
struct id {
using type =3D T;
};
template <class T>
using id_t =3D typename id<T>::type;
template <>
struct id<void> {
using type =3D void;
template <class U>
U&& operator(U&& u) { return forward<U>(u); }
};
The drawback is that to name the identity function we need id<>{}
An alternative is to place the id meta function on a meta namespace (As=20
Eric's meta library [1] does) and define an id lambda function=20
(constexpr function object) as Lousi's Hana library does [1]
namespace meta {
template <class T>
struct id {
using type =3D T;
};
template <class T>
using id_t =3D typename id<T>::type;
}
/* constexpr*/ auto id =3D [](auto&& x) { return forward<decltype(x)>(x); }=
;
Vicente
[1]. See=20
https://github.com/ericniebler/meta/blob/master/include/meta/meta.hpp
--=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/.
--------------060900030605030103010902
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
</head>
<body text=3D"#000000" bgcolor=3D"#FFFFFF">
<div class=3D"moz-cite-prefix">Le 20/02/15 05:25, Zhihao Yuan a
=C3=A9crit=C2=A0:<br>
</div>
<blockquote
cite=3D"mid:CAGsORuAeHRKpT3URyJMr5-0vDn1Sfs1xU6YmG8nigKHcT6zXyw@mail.gmail.=
com"
type=3D"cite">
<pre wrap=3D"">On Thu, Feb 19, 2015 at 10:15 PM, Arthur O'Dwyer
<a class=3D"moz-txt-link-rfc2396E" href=3D"mailto:arthur.j.odwyer@gmail.com=
"><arthur.j.odwyer@gmail.com></a> wrote:
</pre>
<blockquote type=3D"cite">
<pre wrap=3D"">
wiki.edg.com requires a login and password in order to view pages, and when
I try to create a login via
<a class=3D"moz-txt-link-freetext" href=3D"http://wiki.edg.com/twiki/bin/vi=
ew/TWiki/TWikiRegistration">http://wiki.edg.com/twiki/bin/view/TWiki/TWikiR=
egistration</a>
it sends me to a "403 Forbidden" page at
<a class=3D"moz-txt-link-freetext" href=3D"http://wiki.edg.com/twiki/bin/re=
gister/Main/WebHome">http://wiki.edg.com/twiki/bin/register/Main/WebHome</a=
>
So I can't see the LEWG comments.
But if I could see them, I'd be happy to update the proposal accordingly.
</pre>
</blockquote>
<pre wrap=3D"">
Write a new one, bring it to Lenexa meeting, and
you will get the access.
</pre>
<blockquote type=3D"cite">
<pre wrap=3D"">
(My personal view so far is that identity<T>::operator() shouldn't ex=
ist;
just identity<T>::type and its alias identity_t<T>. But I wonde=
r what LEWG's
view was.)
</pre>
</blockquote>
<pre wrap=3D"">
LEWG spent some time on discussing how to make
the operator() work in Chicago, including constraining
the template and choosing the header file choice, but
no poll was taken to show which approach is favored.
If you want to champion one approach, please provide
the reason in your paper.
Also, if you want to use the name `identity`, you need
a survey on existing implementations to see whether
the old SGI `identity` is still in use, etc.
</pre>
</blockquote>
<font size=3D"+1"><br>
I propose <br>
* to use id instead of identity to avoid the backward
compatibility constraint and <br>
* to remove the operator() from id<T> as it is not really
needed, id<>{} is the identity function object.<br>
<br>
Would the following </font>be less controversial<br>
<br>
template <class T=3Dvoid><br>
struct id {<br>
=C2=A0 using type =3D T;<br>
};<br>
<br>
template <class T><br>
using id_t =3D typename id<T>::type;<br>
<br>
template <><br>
struct id<void> {<br>
=C2=A0 using type =3D void;<br>
=C2=A0 template <class U> <br>
=C2=A0 U&& operator(U&& u) { return forward<U>(u)=
;
} <br>
};<br>
<br>
The drawback is that to name the identity function we need
id<>{}<br>
<br>
An alternative is to place the id meta function on a meta namespace
(As Eric's meta library [1] does) and define an id lambda function
(constexpr function object) as Lousi's Hana library does [1]<br>
<br>
namespace meta {<br>
<br>
=C2=A0 template <class T><br>
=C2=A0=C2=A0
struct id {<br>
=C2=A0=C2=A0=C2=A0 using type =3D T;<br>
=C2=A0=C2=A0
};<br>
<br>
=C2=A0=C2=A0
template <class T><br>
=C2=A0=C2=A0
using id_t =3D typename id<T>::type;<br>
<br>
}<br>
<br>
/* constexpr*/ auto id =3D [](auto&& x) { return
forward<decltype(x)>(x); };<br>
<br>
Vicente<br>
<br>
[1]. See
<a class=3D"moz-txt-link-freetext" href=3D"https://github.com/ericniebl=
er/meta/blob/master/include/meta/meta.hpp">https://github.com/ericniebler/m=
eta/blob/master/include/meta/meta.hpp</a><br>
<br>
</body>
</html>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--------------060900030605030103010902--
.
Author: Miro Knejp <miro.knejp@gmail.com>
Date: Sun, 22 Feb 2015 12:49:37 +0100
Raw View
This is a multi-part message in MIME format.
--------------070601080204060306050601
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Just a heads up: There might be resistance to "id" based on it being a=20
builtin type in Objective-C, as is "id<X>". Those are very frequently=20
used and at least one compiler (Clang) can parse both languages combined=20
as Obejctive-C++ to bridge the two, which then might result in=20
ambiguities. So even though it is not a C++ problem per se it is a=20
possible conflict worth keeping in might.
Am 22.02.2015 um 10:42 schrieb Vicente J. Botet Escriba:
> Le 20/02/15 05:25, Zhihao Yuan a =C3=A9crit :
>> On Thu, Feb 19, 2015 at 10:15 PM, Arthur O'Dwyer
>> <arthur.j.odwyer@gmail.com> wrote:
>>> wiki.edg.com requires a login and password in order to view pages, and =
when
>>> I try to create a login via
>>> http://wiki.edg.com/twiki/bin/view/TWiki/TWikiRegistration
>>> it sends me to a "403 Forbidden" page at
>>> http://wiki.edg.com/twiki/bin/register/Main/WebHome
>>> So I can't see the LEWG comments.
>>>
>>> But if I could see them, I'd be happy to update the proposal accordingl=
y.
>> Write a new one, bring it to Lenexa meeting, and
>> you will get the access.
>>
>>> (My personal view so far is that identity<T>::operator() shouldn't exis=
t;
>>> just identity<T>::type and its alias identity_t<T>. But I wonder what L=
EWG's
>>> view was.)
>>>
>> LEWG spent some time on discussing how to make
>> the operator() work in Chicago, including constraining
>> the template and choosing the header file choice, but
>> no poll was taken to show which approach is favored.
>> If you want to champion one approach, please provide
>> the reason in your paper.
>>
>> Also, if you want to use the name `identity`, you need
>> a survey on existing implementations to see whether
>> the old SGI `identity` is still in use, etc.
>>
>
> I propose
> * to use id instead of identity to avoid the backward compatibility=20
> constraint and
> * to remove the operator() from id<T> as it is not really needed,=20
> id<>{} is the identity function object.
>
> Would the following be less controversial
>
> template <class T=3Dvoid>
> struct id {
> using type =3D T;
> };
>
> template <class T>
> using id_t =3D typename id<T>::type;
>
> template <>
> struct id<void> {
> using type =3D void;
> template <class U>
> U&& operator(U&& u) { return forward<U>(u); }
> };
>
> The drawback is that to name the identity function we need id<>{}
>
> An alternative is to place the id meta function on a meta namespace=20
> (As Eric's meta library [1] does) and define an id lambda function=20
> (constexpr function object) as Lousi's Hana library does [1]
>
> namespace meta {
>
> template <class T>
> struct id {
> using type =3D T;
> };
>
> template <class T>
> using id_t =3D typename id<T>::type;
>
> }
>
> /* constexpr*/ auto id =3D [](auto&& x) { return forward<decltype(x)>(x);=
};
>
> Vicente
>
> [1]. See=20
> https://github.com/ericniebler/meta/blob/master/include/meta/meta.hpp
>
> --=20
>
> ---
> You received this message because you are subscribed to the Google=20
> Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send=20
> an email to std-proposals+unsubscribe@isocpp.org=20
> <mailto:std-proposals+unsubscribe@isocpp.org>.
> To post to this group, send email to std-proposals@isocpp.org=20
> <mailto:std-proposals@isocpp.org>.
> Visit this group at=20
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
--=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/.
--------------070601080204060306050601
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
Just a heads up: There might be resistance to "id" based on it being
a builtin type in Objective-C, as is "id<X>". Those are very
frequently used and at least one compiler (Clang) can parse both
languages combined as Obejctive-C++ to bridge the two, which then
might result in ambiguities. So even though it is not a C++ problem
per se it is a possible conflict worth keeping in might.<br>
<br>
<div class=3D"moz-cite-prefix">Am 22.02.2015 um 10:42 schrieb Vicente
J. Botet Escriba:<br>
</div>
<blockquote cite=3D"mid:54E9A47B.9070706@wanadoo.fr" type=3D"cite">
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Ty=
pe">
<div class=3D"moz-cite-prefix">Le 20/02/15 05:25, Zhihao Yuan a
=C3=A9crit=C2=A0:<br>
</div>
<blockquote
cite=3D"mid:CAGsORuAeHRKpT3URyJMr5-0vDn1Sfs1xU6YmG8nigKHcT6zXyw@mail.gmail.=
com"
type=3D"cite">
<pre wrap=3D"">On Thu, Feb 19, 2015 at 10:15 PM, Arthur O'Dwyer
<a moz-do-not-send=3D"true" class=3D"moz-txt-link-rfc2396E" href=3D"mailto:=
arthur.j.odwyer@gmail.com"><arthur.j.odwyer@gmail.com></a> wrote:
</pre>
<blockquote type=3D"cite">
<pre wrap=3D"">wiki.edg.com requires a login and password in orde=
r to view pages, and when
I try to create a login via
<a moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext" href=3D"http://=
wiki.edg.com/twiki/bin/view/TWiki/TWikiRegistration">http://wiki.edg.com/tw=
iki/bin/view/TWiki/TWikiRegistration</a>
it sends me to a "403 Forbidden" page at
<a moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext" href=3D"http://=
wiki.edg.com/twiki/bin/register/Main/WebHome">http://wiki.edg.com/twiki/bin=
/register/Main/WebHome</a>
So I can't see the LEWG comments.
But if I could see them, I'd be happy to update the proposal accordingly.
</pre>
</blockquote>
<pre wrap=3D"">Write a new one, bring it to Lenexa meeting, and
you will get the access.
</pre>
<blockquote type=3D"cite">
<pre wrap=3D"">(My personal view so far is that identity<T>=
::operator() shouldn't exist;
just identity<T>::type and its alias identity_t<T>. But I wonde=
r what LEWG's
view was.)
</pre>
</blockquote>
<pre wrap=3D"">LEWG spent some time on discussing how to make
the operator() work in Chicago, including constraining
the template and choosing the header file choice, but
no poll was taken to show which approach is favored.
If you want to champion one approach, please provide
the reason in your paper.
Also, if you want to use the name `identity`, you need
a survey on existing implementations to see whether
the old SGI `identity` is still in use, etc.
</pre>
</blockquote>
<font size=3D"+1"><br>
I propose <br>
* to use id instead of identity to avoid the backward
compatibility constraint and <br>
* to remove the operator() from id<T> as it is not really
needed, id<>{} is the identity function object.<br>
<br>
Would the following </font>be less controversial<br>
<br>
template <class T=3Dvoid><br>
struct id {<br>
=C2=A0 using type =3D T;<br>
};<br>
<br>
template <class T><br>
using id_t =3D typename id<T>::type;<br>
<br>
template <><br>
struct id<void> {<br>
=C2=A0 using type =3D void;<br>
=C2=A0 template <class U> <br>
=C2=A0 U&& operator(U&& u) { return
forward<U>(u); } <br>
};<br>
<br>
The drawback is that to name the identity function we need
id<>{}<br>
<br>
An alternative is to place the id meta function on a meta
namespace (As Eric's meta library [1] does) and define an id
lambda function (constexpr function object) as Lousi's Hana
library does [1]<br>
<br>
namespace meta {<br>
<br>
=C2=A0 template <class T><br>
=C2=A0=C2=A0 struct id {<br>
=C2=A0=C2=A0=C2=A0 using type =3D T;<br>
=C2=A0=C2=A0 };<br>
<br>
=C2=A0=C2=A0 template <class T><br>
=C2=A0=C2=A0 using id_t =3D typename id<T>::type;<br>
<br>
}<br>
<br>
/* constexpr*/ auto id =3D [](auto&& x) { return
forward<decltype(x)>(x); };<br>
<br>
Vicente<br>
<br>
[1]. See <a moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext"
href=3D"https://github.com/ericniebler/meta/blob/master/include/meta/meta.h=
pp">https://github.com/ericniebler/meta/blob/master/include/meta/meta.hpp</=
a><br>
<br>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google
Groups "ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it,
send an email to <a moz-do-not-send=3D"true"
href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+=
unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a moz-do-not-send=3D"true"
href=3D"mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</=
a>.<br>
Visit this group at <a moz-do-not-send=3D"true"
href=3D"http://groups.google.com/a/isocpp.org/group/std-proposals/"=
>http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br>
</blockquote>
<br>
</body>
</html>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--------------070601080204060306050601--
.
Author: Matthew Fioravante <fmatthew5876@gmail.com>
Date: Sun, 22 Feb 2015 07:01:04 -0800 (PST)
Raw View
------=_Part_2391_1654989654.1424617264061
Content-Type: multipart/alternative;
boundary="----=_Part_2392_1202918834.1424617264061"
------=_Part_2392_1202918834.1424617264061
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
"id" also commonly means identifier. The name could be misleading.
Another possibility could be std::same<T> or maybe std::identical<T>
On Sunday, February 22, 2015 at 6:47:55 AM UTC-5, Miro Knejp wrote:
>
> Just a heads up: There might be resistance to "id" based on it being a=
=20
> builtin type in Objective-C, as is "id<X>". Those are very frequently use=
d=20
> and at least one compiler (Clang) can parse both languages combined as=20
> Obejctive-C++ to bridge the two, which then might result in ambiguities. =
So=20
> even though it is not a C++ problem per se it is a possible conflict wort=
h=20
> keeping in might.
>
> Am 22.02.2015 um 10:42 schrieb Vicente J. Botet Escriba:
> =20
> Le 20/02/15 05:25, Zhihao Yuan a =C3=A9crit :
> =20
> On Thu, Feb 19, 2015 at 10:15 PM, Arthur O'Dwyer<arthur....@gmail.com> <j=
avascript:> wrote:
>
> wiki.edg.com requires a login and password in order to view pages, and w=
hen
> I try to create a login viahttp://wiki.edg.com/twiki/bin/view/TWiki/TWiki=
Registration
> it sends me to a "403 Forbidden" page athttp://wiki.edg.com/twiki/bin/reg=
ister/Main/WebHome
> So I can't see the LEWG comments.
>
> But if I could see them, I'd be happy to update the proposal accordingly.
>
> Write a new one, bring it to Lenexa meeting, and
> you will get the access.
>
>
> (My personal view so far is that identity<T>::operator() shouldn't exist=
;
> just identity<T>::type and its alias identity_t<T>. But I wonder what LEW=
G's
> view was.)
>
>
> LEWG spent some time on discussing how to make
> the operator() work in Chicago, including constraining
> the template and choosing the header file choice, but
> no poll was taken to show which approach is favored.
> If you want to champion one approach, please provide
> the reason in your paper.
>
> Also, if you want to use the name `identity`, you need
> a survey on existing implementations to see whether
> the old SGI `identity` is still in use, etc.
>
>
> =20
> I propose=20
> * to use id instead of identity to avoid the backward compatibility=20
> constraint and=20
> * to remove the operator() from id<T> as it is not really needed, id<>{}=
=20
> is the identity function object.
>
> Would the following be less controversial
>
> template <class T=3Dvoid>
> struct id {
> using type =3D T;
> };
>
> template <class T>
> using id_t =3D typename id<T>::type;
>
> template <>
> struct id<void> {
> using type =3D void;
> template <class U>=20
> U&& operator(U&& u) { return forward<U>(u); }=20
> };
>
> The drawback is that to name the identity function we need id<>{}
>
> An alternative is to place the id meta function on a meta namespace (As=
=20
> Eric's meta library [1] does) and define an id lambda function (constexpr=
=20
> function object) as Lousi's Hana library does [1]
>
> namespace meta {
>
> template <class T>
> struct id {
> using type =3D T;
> };
>
> template <class T>
> using id_t =3D typename id<T>::type;
>
> }
>
> /* constexpr*/ auto id =3D [](auto&& x) { return forward<decltype(x)>(x);=
};
>
> Vicente
>
> [1]. See=20
> https://github.com/ericniebler/meta/blob/master/include/meta/meta.hpp
>
> --=20
>
> ---=20
> You received this message because you are subscribed to the Google Groups=
=20
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
=20
> email to std-proposal...@isocpp.org <javascript:>.
> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
> Visit this group at=20
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
>
>=20
--=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/.
------=_Part_2392_1202918834.1424617264061
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">"id" also commonly means identifier. The name could be mis=
leading.<div><br></div><div>Another possibility could be std::same<T>=
or maybe std::identical<T><br><br>On Sunday, February 22, 2015 at 6:=
47:55 AM UTC-5, Miro Knejp wrote:<blockquote class=3D"gmail_quote" style=3D=
"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex=
;">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000">
Just a heads up: There might be resistance to "id" based on it being
a builtin type in Objective-C, as is "id<X>". Those are very
frequently used and at least one compiler (Clang) can parse both
languages combined as Obejctive-C++ to bridge the two, which then
might result in ambiguities. So even though it is not a C++ problem
per se it is a possible conflict worth keeping in might.<br>
<br>
<div>Am 22.02.2015 um 10:42 schrieb Vicente
J. Botet Escriba:<br>
</div>
<blockquote type=3D"cite">
=20
<div>Le 20/02/15 05:25, Zhihao Yuan a
=C3=A9crit :<br>
</div>
<blockquote type=3D"cite">
<pre>On Thu, Feb 19, 2015 at 10:15 PM, Arthur O'Dwyer
<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"6l6DwYYS=
fvcJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:';return true=
;" onclick=3D"this.href=3D'javascript:';return true;"><arthur....@gmail.=
com></a> wrote:
</pre>
<blockquote type=3D"cite">
<pre><a href=3D"http://wiki.edg.com" target=3D"_blank" rel=3D"nof=
ollow" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F=
%2Fwiki.edg.com\46sa\75D\46sntz\0751\46usg\75AFQjCNGc0-B0A0GLRO_SH5IHadJHAN=
JpMg';return true;" onclick=3D"this.href=3D'http://www.google.com/url?q\75h=
ttp%3A%2F%2Fwiki.edg.com\46sa\75D\46sntz\0751\46usg\75AFQjCNGc0-B0A0GLRO_SH=
5IHadJHANJpMg';return true;">wiki.edg.com</a> requires a login and password=
in order to view pages, and when
I try to create a login via
<a href=3D"http://wiki.edg.com/twiki/bin/view/TWiki/TWikiRegistration" targ=
et=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D'http://www.googl=
e.com/url?q\75http%3A%2F%2Fwiki.edg.com%2Ftwiki%2Fbin%2Fview%2FTWiki%2FTWik=
iRegistration\46sa\75D\46sntz\0751\46usg\75AFQjCNEGIJXmj0zeLuR6IDPhj1xrddDI=
cA';return true;" onclick=3D"this.href=3D'http://www.google.com/url?q\75htt=
p%3A%2F%2Fwiki.edg.com%2Ftwiki%2Fbin%2Fview%2FTWiki%2FTWikiRegistration\46s=
a\75D\46sntz\0751\46usg\75AFQjCNEGIJXmj0zeLuR6IDPhj1xrddDIcA';return true;"=
>http://wiki.edg.com/twiki/bin/<wbr>view/TWiki/TWikiRegistration</a>
it sends me to a "403 Forbidden" page at
<a href=3D"http://wiki.edg.com/twiki/bin/register/Main/WebHome" target=3D"_=
blank" rel=3D"nofollow" onmousedown=3D"this.href=3D'http://www.google.com/u=
rl?q\75http%3A%2F%2Fwiki.edg.com%2Ftwiki%2Fbin%2Fregister%2FMain%2FWebHome\=
46sa\75D\46sntz\0751\46usg\75AFQjCNGZY5WCjBHvMLOZcrXTaIDn5vQ9Ig';return tru=
e;" onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fwiki=
..edg.com%2Ftwiki%2Fbin%2Fregister%2FMain%2FWebHome\46sa\75D\46sntz\0751\46u=
sg\75AFQjCNGZY5WCjBHvMLOZcrXTaIDn5vQ9Ig';return true;">http://wiki.edg.com/=
twiki/bin/<wbr>register/Main/WebHome</a>
So I can't see the LEWG comments.
But if I could see them, I'd be happy to update the proposal accordingly.
</pre>
</blockquote>
<pre>Write a new one, bring it to Lenexa meeting, and
you will get the access.
</pre>
<blockquote type=3D"cite">
<pre>(My personal view so far is that identity<T>::operator=
() shouldn't exist;
just identity<T>::type and its alias identity_t<T>. But I wonde=
r what LEWG's
view was.)
</pre>
</blockquote>
<pre>LEWG spent some time on discussing how to make
the operator() work in Chicago, including constraining
the template and choosing the header file choice, but
no poll was taken to show which approach is favored.
If you want to champion one approach, please provide
the reason in your paper.
Also, if you want to use the name `identity`, you need
a survey on existing implementations to see whether
the old SGI `identity` is still in use, etc.
</pre>
</blockquote>
<font size=3D"+1"><br>
I propose <br>
* to use id instead of identity to avoid the backward
compatibility constraint and <br>
* to remove the operator() from id<T> as it is not really
needed, id<>{} is the identity function object.<br>
<br>
Would the following </font>be less controversial<br>
<br>
template <class T=3Dvoid><br>
struct id {<br>
using type =3D T;<br>
};<br>
<br>
template <class T><br>
using id_t =3D typename id<T>::type;<br>
<br>
template <><br>
struct id<void> {<br>
using type =3D void;<br>
template <class U> <br>
U&& operator(U&& u) { return
forward<U>(u); } <br>
};<br>
<br>
The drawback is that to name the identity function we need
id<>{}<br>
<br>
An alternative is to place the id meta function on a meta
namespace (As Eric's meta library [1] does) and define an id
lambda function (constexpr function object) as Lousi's Hana
library does [1]<br>
<br>
namespace meta {<br>
<br>
template <class T><br>
struct id {<br>
using type =3D T;<br>
};<br>
<br>
template <class T><br>
using id_t =3D typename id<T>::type;<br>
<br>
}<br>
<br>
/* constexpr*/ auto id =3D [](auto&& x) { return
forward<decltype(x)>(x); };<br>
<br>
Vicente<br>
<br>
[1]. See <a href=3D"https://github.com/ericniebler/meta/blob/master/i=
nclude/meta/meta.hpp" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"thi=
s.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fericnie=
bler%2Fmeta%2Fblob%2Fmaster%2Finclude%2Fmeta%2Fmeta.hpp\46sa\75D\46sntz\075=
1\46usg\75AFQjCNFij6cod2eOxjVli-R0d-vTxB8gTQ';return true;" onclick=3D"this=
..href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fericnieb=
ler%2Fmeta%2Fblob%2Fmaster%2Finclude%2Fmeta%2Fmeta.hpp\46sa\75D\46sntz\0751=
\46usg\75AFQjCNFij6cod2eOxjVli-R0d-vTxB8gTQ';return true;">https://github.c=
om/<wbr>ericniebler/meta/blob/master/<wbr>include/meta/meta.hpp</a><br>
<br>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google
Groups "ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it,
send an email to <a href=3D"javascript:" target=3D"_blank" gdf-obfusc=
ated-mailto=3D"6l6DwYYSfvcJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'j=
avascript:';return true;" onclick=3D"this.href=3D'javascript:';return true;=
">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=
=3D"_blank" gdf-obfuscated-mailto=3D"6l6DwYYSfvcJ" rel=3D"nofollow" onmouse=
down=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'jav=
ascript:';return true;">std-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/=
group/std-proposals/" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"thi=
s.href=3D'http://groups.google.com/a/isocpp.org/group/std-proposals/';retur=
n true;" onclick=3D"this.href=3D'http://groups.google.com/a/isocpp.org/grou=
p/std-proposals/';return true;">http://groups.google.com/a/<wbr>isocpp.org/=
group/std-<wbr>proposals/</a>.<br>
</blockquote>
<br>
</div>
</blockquote></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_2392_1202918834.1424617264061--
------=_Part_2391_1654989654.1424617264061--
.
Author: Scott Prager <splinterofchaos@gmail.com>
Date: Sun, 22 Feb 2015 10:31:11 -0800 (PST)
Raw View
------=_Part_2569_1187982801.1424629871111
Content-Type: multipart/alternative;
boundary="----=_Part_2570_1271470248.1424629871111"
------=_Part_2570_1271470248.1424629871111
Content-Type: text/plain; charset=UTF-8
On Sunday, February 22, 2015 at 4:42:22 AM UTC-5, Vicente J. Botet Escriba
wrote:
> I propose
> * to use id instead of identity to avoid the backward compatibility
> constraint and
> * to remove the operator() from id<T> as it is not really needed, id<>{}
> is the identity function object.
>
> Would the following be less controversial
>
> template <class T=void>
> struct id {
> using type = T;
> };
>
> template <class T>
> using id_t = typename id<T>::type;
>
> template <>
> struct id<void> {
> using type = void;
> template <class U>
> U&& operator(U&& u) { return forward<U>(u); }
> };
>
> The drawback is that to name the identity function we need id<>{}
>
std::plus<>{}, std::equal_to<>{}, std::less<>{}, etc..
Unfortunately, doing it any other way would be inconsistent.
I think it's actually kinda neat: we can merge the concepts of
meta-functions with function objects to create something that
serves both! I just wonder if the weirdness overcomes the
practicality, or if there are any other similar utilities that could
be useful.
>
> An alternative is to place the id meta function on a meta namespace (As
> Eric's meta library [1] does) and define an id lambda function (constexpr
> function object) as Lousi's Hana library does [1]
>
> namespace meta {
>
> template <class T>
> struct id {
> using type = T;
> };
>
> template <class T>
> using id_t = typename id<T>::type;
>
> }
>
> /* constexpr*/ auto id = [](auto&& x) { return forward<decltype(x)>(x); };
>
I think that would make sense if someone wanted to propose a
*meta* library, but would be pretty weak as a stand-alone. Though I'm
a little peeved that what I consider to be primitives can't be properly
implemented.
https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/yTDFOtni3no
Other than that, Niebler's library might be a good starting point.
> Vicente
>
> [1]. See
> https://github.com/ericniebler/meta/blob/master/include/meta/meta.hpp
> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fericniebler%2Fmeta%2Fblob%2Fmaster%2Finclude%2Fmeta%2Fmeta.hpp&sa=D&sntz=1&usg=AFQjCNFij6cod2eOxjVli-R0d-vTxB8gTQ>
>
>
--
---
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/.
------=_Part_2570_1271470248.1424629871111
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Sunday, February 22, 2015 at 4:42:22 AM UTC-5, =
Vicente J. Botet Escriba wrote:<div> </div><blockquote class=3D"gmail_=
quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;pa=
dding-left: 1ex;"><div text=3D"#000000" bgcolor=3D"#FFFFFF"><font size=3D"+=
1">
I propose <br>
* to use id instead of identity to avoid the backward
compatibility constraint and <br>
* to remove the operator() from id<T> as it is not really
needed, id<>{} is the identity function object.<br>
<br>
Would the following </font>be less controversial<br>
<br>
template <class T=3Dvoid><br>
struct id {<br>
using type =3D T;<br>
};<br>
<br>
template <class T><br>
using id_t =3D typename id<T>::type;<br>
<br>
template <><br>
struct id<void> {<br>
using type =3D void;<br>
template <class U> <br>
U&& operator(U&& u) { return forward<U>(u)=
;
} <br>
};<br>
<br>
The drawback is that to name the identity function we need
id<>{}<br></div></blockquote><div><br></div><div>std::plus<>=
;{}, std::equal_to<>{}, std::less<>{}, etc..</div><div>Unfortun=
ately, doing it any other way would be inconsistent.</div><div><br></div><d=
iv>I think it's actually kinda neat: we can merge the concepts of</div><div=
>meta-functions with function objects to create something that</div><div>se=
rves both! I just wonder if the weirdness overcomes the</div><div>practical=
ity, or if there are any other similar utilities that could</div><div>be us=
eful.</div><div> </div><div> </div><blockquote class=3D"gma=
il_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid=
;padding-left: 1ex;"><div text=3D"#000000" bgcolor=3D"#FFFFFF">
<br>
An alternative is to place the id meta function on a meta namespace
(As Eric's meta library [1] does) and define an id lambda function
(constexpr function object) as Lousi's Hana library does [1]<br>
<br>
namespace meta {<br>
<br>
template <class T><br>
struct id {<br>
using type =3D T;<br>
};<br>
<br>
template <class T><br>
using id_t =3D typename id<T>::type;<br>
<br>
}<br>
<br>
/* constexpr*/ auto id =3D [](auto&& x) { return
forward<decltype(x)>(x); };<br></div></blockquote><div><br></div>=
<div>I think that would make sense if someone wanted to propose a</div><div=
><i>meta</i> library, but would be pretty weak as a stand-alone. Thoug=
h I'm</div><div>a little peeved that what I consider to be primitives can't=
be properly</div><div>implemented.</div><div>https://groups.google.com/a/i=
socpp.org/forum/#!topic/std-discussion/yTDFOtni3no</div><div><br></div><div=
> Other than that, Niebler's library might be a good starting point.</=
div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div text=
=3D"#000000" bgcolor=3D"#FFFFFF">
<br>
Vicente<br>
<br>
[1]. See
<a href=3D"https://www.google.com/url?q=3Dhttps%3A%2F%2Fgithub.com%2Fer=
icniebler%2Fmeta%2Fblob%2Fmaster%2Finclude%2Fmeta%2Fmeta.hpp&sa=3DD&=
;sntz=3D1&usg=3DAFQjCNFij6cod2eOxjVli-R0d-vTxB8gTQ" target=3D"_blank" r=
el=3D"nofollow" onmousedown=3D"this.href=3D'https://www.google.com/url?q\75=
https%3A%2F%2Fgithub.com%2Fericniebler%2Fmeta%2Fblob%2Fmaster%2Finclude%2Fm=
eta%2Fmeta.hpp\46sa\75D\46sntz\0751\46usg\75AFQjCNFij6cod2eOxjVli-R0d-vTxB8=
gTQ';return true;" onclick=3D"this.href=3D'https://www.google.com/url?q\75h=
ttps%3A%2F%2Fgithub.com%2Fericniebler%2Fmeta%2Fblob%2Fmaster%2Finclude%2Fme=
ta%2Fmeta.hpp\46sa\75D\46sntz\0751\46usg\75AFQjCNFij6cod2eOxjVli-R0d-vTxB8g=
TQ';return true;">https://github.com/<wbr>ericniebler/meta/blob/master/<wbr=
>include/meta/meta.hpp</a><br>
<br>
</div>
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_2570_1271470248.1424629871111--
------=_Part_2569_1187982801.1424629871111--
.
Author: Scott Prager <splinterofchaos@gmail.com>
Date: Sun, 22 Feb 2015 10:37:04 -0800 (PST)
Raw View
------=_Part_2528_1147900500.1424630224534
Content-Type: multipart/alternative;
boundary="----=_Part_2529_1918102499.1424630224534"
------=_Part_2529_1918102499.1424630224534
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Sunday, February 22, 2015 at 10:01:04 AM UTC-5, Matthew Fioravante wrote=
:
>
> "id" also commonly means identifier. The name could be misleading.
>
Though, I think that most programmers have enough of a math background
to know what the identity function is. Anyone who might think "id" means
"identifier" might also think the same of "identity".
=20
> Another possibility could be std::same<T> or maybe std::identical<T>
>
"same" and "identical" seem to imply a type relation; might be confused wit=
h
*std::is_same*. The only alternate name I can think of is maybe just call i=
t
"type<T>", but that feels a little ambiguous.
=20
>
> On Sunday, February 22, 2015 at 6:47:55 AM UTC-5, Miro Knejp wrote:
>>
>> Just a heads up: There might be resistance to "id" based on it being a=
=20
>> builtin type in Objective-C, as is "id<X>". Those are very frequently us=
ed=20
>> and at least one compiler (Clang) can parse both languages combined as=
=20
>> Obejctive-C++ to bridge the two, which then might result in ambiguities.=
So=20
>> even though it is not a C++ problem per se it is a possible conflict wor=
th=20
>> keeping in might.
>>
>> Am 22.02.2015 um 10:42 schrieb Vicente J. Botet Escriba:
>> =20
>> Le 20/02/15 05:25, Zhihao Yuan a =C3=A9crit :
>> =20
>> On Thu, Feb 19, 2015 at 10:15 PM, Arthur O'Dwyer<arthur....@gmail.com> w=
rote:
>>
>> wiki.edg.com requires a login and password in order to view pages, and =
when
>> I try to create a login viahttp://wiki.edg.com/twiki/bin/view/TWiki/TWik=
iRegistration
>> it sends me to a "403 Forbidden" page athttp://wiki.edg.com/twiki/bin/re=
gister/Main/WebHome
>> So I can't see the LEWG comments.
>>
>> But if I could see them, I'd be happy to update the proposal accordingly=
..
>>
>> Write a new one, bring it to Lenexa meeting, and
>> you will get the access.
>>
>>
>> (My personal view so far is that identity<T>::operator() shouldn't exis=
t;
>> just identity<T>::type and its alias identity_t<T>. But I wonder what LE=
WG's
>> view was.)
>>
>>
>> LEWG spent some time on discussing how to make
>> the operator() work in Chicago, including constraining
>> the template and choosing the header file choice, but
>> no poll was taken to show which approach is favored.
>> If you want to champion one approach, please provide
>> the reason in your paper.
>>
>> Also, if you want to use the name `identity`, you need
>> a survey on existing implementations to see whether
>> the old SGI `identity` is still in use, etc.
>>
>>
>> =20
>> I propose=20
>> * to use id instead of identity to avoid the backward compatibility=20
>> constraint and=20
>> * to remove the operator() from id<T> as it is not really needed, id<>{}=
=20
>> is the identity function object.
>>
>> Would the following be less controversial
>>
>> template <class T=3Dvoid>
>> struct id {
>> using type =3D T;
>> };
>>
>> template <class T>
>> using id_t =3D typename id<T>::type;
>>
>> template <>
>> struct id<void> {
>> using type =3D void;
>> template <class U>=20
>> U&& operator(U&& u) { return forward<U>(u); }=20
>> };
>>
>> The drawback is that to name the identity function we need id<>{}
>>
>> An alternative is to place the id meta function on a meta namespace (As=
=20
>> Eric's meta library [1] does) and define an id lambda function (constexp=
r=20
>> function object) as Lousi's Hana library does [1]
>>
>> namespace meta {
>>
>> template <class T>
>> struct id {
>> using type =3D T;
>> };
>>
>> template <class T>
>> using id_t =3D typename id<T>::type;
>>
>> }
>>
>> /* constexpr*/ auto id =3D [](auto&& x) { return forward<decltype(x)>(x)=
; };
>>
>> Vicente
>>
>> [1]. See=20
>> https://github.com/ericniebler/meta/blob/master/include/meta/meta.hpp
>>
>> --=20
>>
>> ---=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org.
>> To post to this group, send email to std-pr...@isocpp.org.
>> Visit this group at=20
>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>
>>
>>=20
--=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/.
------=_Part_2529_1918102499.1424630224534
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Sunday, February 22, 2015 at 10:01:04 AM UTC-5,=
Matthew Fioravante wrote:<blockquote class=3D"gmail_quote" style=3D"margin=
: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div=
dir=3D"ltr">"id" also commonly means identifier. The name could be mislead=
ing.</div></blockquote><div><br></div><div>Though, I think that most progra=
mmers have enough of a math background</div><div>to know what the identity =
function is. Anyone who might think "id" means</div><div>"identifier" might=
also think the same of "identity".</div><div> </div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Another possibility could=
be std::same<T> or maybe std::identical<T><br></div></div></bl=
ockquote><div><br></div><div>"same" and "identical" seem to imply a type re=
lation; might be confused with</div><div><i>std::is_same</i>. The only alte=
rnate name I can think of is maybe just call it</div><div>"type<T>", =
but that feels a little ambiguous.</div><div> </div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr"><div><br>On Sunday, February 2=
2, 2015 at 6:47:55 AM UTC-5, Miro Knejp wrote:<blockquote class=3D"gmail_qu=
ote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding=
-left:1ex">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000">
Just a heads up: There might be resistance to "id" based on it being
a builtin type in Objective-C, as is "id<X>". Those are very
frequently used and at least one compiler (Clang) can parse both
languages combined as Obejctive-C++ to bridge the two, which then
might result in ambiguities. So even though it is not a C++ problem
per se it is a possible conflict worth keeping in might.<br>
<br>
<div>Am 22.02.2015 um 10:42 schrieb Vicente
J. Botet Escriba:<br>
</div>
<blockquote type=3D"cite">
=20
<div>Le 20/02/15 05:25, Zhihao Yuan a
=C3=A9crit :<br>
</div>
<blockquote type=3D"cite">
<pre>On Thu, Feb 19, 2015 at 10:15 PM, Arthur O'Dwyer
<a rel=3D"nofollow"><arthur....@gmail.com></a> wrote:
</pre>
<blockquote type=3D"cite">
<pre><a href=3D"http://wiki.edg.com" rel=3D"nofollow" target=3D"_=
blank" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F=
%2Fwiki.edg.com\46sa\75D\46sntz\0751\46usg\75AFQjCNGc0-B0A0GLRO_SH5IHadJHAN=
JpMg';return true;" onclick=3D"this.href=3D'http://www.google.com/url?q\75h=
ttp%3A%2F%2Fwiki.edg.com\46sa\75D\46sntz\0751\46usg\75AFQjCNGc0-B0A0GLRO_SH=
5IHadJHANJpMg';return true;">wiki.edg.com</a> requires a login and password=
in order to view pages, and when
I try to create a login via
<a href=3D"http://wiki.edg.com/twiki/bin/view/TWiki/TWikiRegistration" rel=
=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D'http://www.goog=
le.com/url?q\75http%3A%2F%2Fwiki.edg.com%2Ftwiki%2Fbin%2Fview%2FTWiki%2FTWi=
kiRegistration\46sa\75D\46sntz\0751\46usg\75AFQjCNEGIJXmj0zeLuR6IDPhj1xrddD=
IcA';return true;" onclick=3D"this.href=3D'http://www.google.com/url?q\75ht=
tp%3A%2F%2Fwiki.edg.com%2Ftwiki%2Fbin%2Fview%2FTWiki%2FTWikiRegistration\46=
sa\75D\46sntz\0751\46usg\75AFQjCNEGIJXmj0zeLuR6IDPhj1xrddDIcA';return true;=
">http://wiki.edg.com/twiki/bin/<wbr>view/TWiki/TWikiRegistration</a>
it sends me to a "403 Forbidden" page at
<a href=3D"http://wiki.edg.com/twiki/bin/register/Main/WebHome" rel=3D"nofo=
llow" target=3D"_blank" onmousedown=3D"this.href=3D'http://www.google.com/u=
rl?q\75http%3A%2F%2Fwiki.edg.com%2Ftwiki%2Fbin%2Fregister%2FMain%2FWebHome\=
46sa\75D\46sntz\0751\46usg\75AFQjCNGZY5WCjBHvMLOZcrXTaIDn5vQ9Ig';return tru=
e;" onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fwiki=
..edg.com%2Ftwiki%2Fbin%2Fregister%2FMain%2FWebHome\46sa\75D\46sntz\0751\46u=
sg\75AFQjCNGZY5WCjBHvMLOZcrXTaIDn5vQ9Ig';return true;">http://wiki.edg.com/=
twiki/bin/<wbr>register/Main/WebHome</a>
So I can't see the LEWG comments.
But if I could see them, I'd be happy to update the proposal accordingly.
</pre>
</blockquote>
<pre>Write a new one, bring it to Lenexa meeting, and
you will get the access.
</pre>
<blockquote type=3D"cite">
<pre>(My personal view so far is that identity<T>::operator=
() shouldn't exist;
just identity<T>::type and its alias identity_t<T>. But I wonde=
r what LEWG's
view was.)
</pre>
</blockquote>
<pre>LEWG spent some time on discussing how to make
the operator() work in Chicago, including constraining
the template and choosing the header file choice, but
no poll was taken to show which approach is favored.
If you want to champion one approach, please provide
the reason in your paper.
Also, if you want to use the name `identity`, you need
a survey on existing implementations to see whether
the old SGI `identity` is still in use, etc.
</pre>
</blockquote>
<font size=3D"+1"><br>
I propose <br>
* to use id instead of identity to avoid the backward
compatibility constraint and <br>
* to remove the operator() from id<T> as it is not really
needed, id<>{} is the identity function object.<br>
<br>
Would the following </font>be less controversial<br>
<br>
template <class T=3Dvoid><br>
struct id {<br>
using type =3D T;<br>
};<br>
<br>
template <class T><br>
using id_t =3D typename id<T>::type;<br>
<br>
template <><br>
struct id<void> {<br>
using type =3D void;<br>
template <class U> <br>
U&& operator(U&& u) { return
forward<U>(u); } <br>
};<br>
<br>
The drawback is that to name the identity function we need
id<>{}<br>
<br>
An alternative is to place the id meta function on a meta
namespace (As Eric's meta library [1] does) and define an id
lambda function (constexpr function object) as Lousi's Hana
library does [1]<br>
<br>
namespace meta {<br>
<br>
template <class T><br>
struct id {<br>
using type =3D T;<br>
};<br>
<br>
template <class T><br>
using id_t =3D typename id<T>::type;<br>
<br>
}<br>
<br>
/* constexpr*/ auto id =3D [](auto&& x) { return
forward<decltype(x)>(x); };<br>
<br>
Vicente<br>
<br>
[1]. See <a href=3D"https://github.com/ericniebler/meta/blob/master/i=
nclude/meta/meta.hpp" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"thi=
s.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fericnie=
bler%2Fmeta%2Fblob%2Fmaster%2Finclude%2Fmeta%2Fmeta.hpp\46sa\75D\46sntz\075=
1\46usg\75AFQjCNFij6cod2eOxjVli-R0d-vTxB8gTQ';return true;" onclick=3D"this=
..href=3D'https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Fericnieb=
ler%2Fmeta%2Fblob%2Fmaster%2Finclude%2Fmeta%2Fmeta.hpp\46sa\75D\46sntz\0751=
\46usg\75AFQjCNFij6cod2eOxjVli-R0d-vTxB8gTQ';return true;">https://github.c=
om/<wbr>ericniebler/meta/blob/master/<wbr>include/meta/meta.hpp</a><br>
<br>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google
Groups "ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it,
send an email to <a rel=3D"nofollow">std-proposal...@isocpp.org</a>.<=
br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@is=
ocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/=
group/std-proposals/" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"thi=
s.href=3D'http://groups.google.com/a/isocpp.org/group/std-proposals/';retur=
n true;" onclick=3D"this.href=3D'http://groups.google.com/a/isocpp.org/grou=
p/std-proposals/';return true;">http://groups.google.com/a/<wbr>isocpp.org/=
group/std-<wbr>proposals/</a>.<br>
</blockquote>
<br>
</div>
</blockquote></div></div></blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_2529_1918102499.1424630224534--
------=_Part_2528_1147900500.1424630224534--
.
Author: rhalbersma@gmail.com
Date: Sun, 22 Feb 2015 12:54:56 -0800 (PST)
Raw View
------=_Part_1242_1676143656.1424638496066
Content-Type: multipart/alternative;
boundary="----=_Part_1243_255945046.1424638496066"
------=_Part_1243_255945046.1424638496066
Content-Type: text/plain; charset=UTF-8
I like Walter E. Brown's naming of type_is<T> in his CppCon14 talk
<https://github.com/CppCon/CppCon2014/blob/master/Presentations/Modern%20Template%20Metaprogramming%20-%20A%20Compendium/Modern%20Template%20Metaprogramming%20-%20A%20Compendium%20-%20Walter%20E%20Brown%20-%20CppCon%202014.pdf> (slide
16)
--
---
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/.
------=_Part_1243_255945046.1424638496066
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I like Walter E. Brown's naming of type_is<T> in his=
<a href=3D"https://github.com/CppCon/CppCon2014/blob/master/Presentations/=
Modern%20Template%20Metaprogramming%20-%20A%20Compendium/Modern%20Template%=
20Metaprogramming%20-%20A%20Compendium%20-%20Walter%20E%20Brown%20-%20CppCo=
n%202014.pdf">CppCon14 talk</a> (slide 16)<div><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_1243_255945046.1424638496066--
------=_Part_1242_1676143656.1424638496066--
.
Author: Matthew Woehlke <mw_triad@users.sourceforge.net>
Date: Mon, 23 Feb 2015 10:41:59 -0500
Raw View
On 2015-02-22 04:42, Vicente J. Botet Escriba wrote:
> I propose
> * to use id instead of identity to avoid the backward compatibility
> constraint
"Id" is *massively* used colloquially to mean "identification"... try
asking yourself how often you *don't* hear people substitute "id" when
they mean "identification" :-). In programming, it tends to mean instead
"identifier", although that's essentially the same idea.
Even though we *are* talking the same root as "identity", "identity" is
a specific mathematical term (and yes, I agree most programmers are
probably familiar with the mathematical meaning) that does not really
match up with what people think of as "identifiers".
That said, even "identity" is a bit broad of a concept, as there are
many possible "identities" (additive identity, multiplicative identity,
etc.).
It's (even) more typing, but what about type_identity?
(Too late now, but I find myself wondering if all these type transforms
shouldn't have been in their own namespace to differentiate them from
other operations...)
--
Matthew
--
---
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/.
.
Author: Matthew Fioravante <fmatthew5876@gmail.com>
Date: Tue, 24 Feb 2015 09:38:30 -0800 (PST)
Raw View
------=_Part_4810_1930484432.1424799510405
Content-Type: multipart/alternative;
boundary="----=_Part_4811_1468909748.1424799510405"
------=_Part_4811_1468909748.1424799510405
Content-Type: text/plain; charset=UTF-8
On Monday, February 23, 2015 at 10:42:19 AM UTC-5, Matthew Woehlke wrote:
>
> On 2015-02-22 04:42, Vicente J. Botet Escriba wrote:
> > I propose
> > * to use id instead of identity to avoid the backward compatibility
> > constraint
>
> "Id" is *massively* used colloquially to mean "identification"... try
> asking yourself how often you *don't* hear people substitute "id" when
> they mean "identification" :-). In programming, it tends to mean instead
> "identifier", although that's essentially the same idea.
>
I agree. Probably the majority of C++ applications I've written in my
lifetime have had a for loop with an int id in it. I've also used id as a
class type to wrap an integer indetifier in a type safe way. Basically
whenever I see the "id" in code my mind is immediately thinking of names,
strings, integers, identifiers for objects, for loops, etc..
Even though we *are* talking the same root as "identity", "identity" is
> a specific mathematical term (and yes, I agree most programmers are
> probably familiar with the mathematical meaning) that does not really
> match up with what people think of as "identifiers".
>
> That said, even "identity" is a bit broad of a concept, as there are
> many possible "identities" (additive identity, multiplicative identity,
> etc.).
>
It's (even) more typing, but what about type_identity?
>
Or maybe a shorthand
std::ident<T>
--
---
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/.
------=_Part_4811_1468909748.1424799510405
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Monday, February 23, 2015 at 10:42:19 AM UTC-5,=
Matthew Woehlke wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 2015=
-02-22 04:42, Vicente J. Botet Escriba wrote:
<br>> I propose
<br>> * to use id instead of identity to avoid the backward compatibilit=
y
<br>> constraint
<br>
<br>"Id" is *massively* used colloquially to mean "identification"... try
<br>asking yourself how often you *don't* hear people substitute "id" when
<br>they mean "identification" :-). In programming, it tends to mean instea=
d
<br>"identifier", although that's essentially the same idea.
<br></blockquote><div><br>I agree. Probably the majority of C++ application=
s I've written in my lifetime have had a for loop with an int id in it. I'v=
e also used id as a class type to wrap an integer indetifier in a type safe=
way. Basically whenever I see the "id" in code my mind is immediately thin=
king of names, strings, integers, identifiers for objects, for loops, etc..=
<br><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Even though we *=
are* talking the same root as "identity", "identity" is
<br>a specific mathematical term (and yes, I agree most programmers are
<br>probably familiar with the mathematical meaning) that does not really
<br>match up with what people think of as "identifiers".
<br>
<br>That said, even "identity" is a bit broad of a concept, as there are
<br>many possible "identities" (additive identity, multiplicative identity,
<br>etc.).
<br>
</blockquote><blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">It's (even)=
more typing, but what about type_identity?
<br></blockquote><div><br>Or maybe a shorthand<br><br>std::ident<T> <=
br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_4811_1468909748.1424799510405--
------=_Part_4810_1930484432.1424799510405--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Tue, 24 Feb 2015 15:02:58 -0500
Raw View
--001a11c3fd945cbc16050fdb0130
Content-Type: text/plain; charset=UTF-8
On Tue, Feb 24, 2015 at 12:38 PM, Matthew Fioravante <fmatthew5876@gmail.com
> wrote:
>
>
> Or maybe a shorthand
>
> std::ident<T>
>
> --
>
>
Obviously std::identi<T>. (pronounced as "identi T" or "identity".
:-)
Tony
--
---
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/.
--001a11c3fd945cbc16050fdb0130
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Tue, Feb 24, 2015 at 12:38 PM, Matthew Fioravante <span dir=3D"ltr">=
<<a href=3D"mailto:fmatthew5876@gmail.com" target=3D"_blank">fmatthew587=
6@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr"><span class=3D""><br></span><span class=3D""></span><div><br>Or m=
aybe a shorthand<br><br>std::ident<T> <br></div></div><div class=3D"H=
OEnZb"><div class=3D"h5">
<p></p>
-- <br>
<br></div></div></blockquote><div><br></div></div>Obviously std::identi<=
T>.=C2=A0 (pronounced as "identi T" or "identity".<b=
r>:-)<br><br></div><div class=3D"gmail_extra">Tony<br><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c3fd945cbc16050fdb0130--
.