Topic: is_transparent and generic lambdas


Author: mike.marcin@gmail.com
Date: Thu, 14 Nov 2013 11:04:56 -0800 (PST)
Raw View
------=_Part_5424_31032402.1384455896935
Content-Type: text/plain; charset=ISO-8859-1

If I specify a generic lambda as a key comparison for an associative
container will it have an is_transparent typedef?

auto comp = []( const auto& x, const auto& y )
{
return boost::iequals( x, y );
}

map<string,int,decltype(comp)> m(comp);

// If I understand correctly this should not
// construct a temporary string if
// the generic lambda has is_transparent
m.find( string_view("hello world") );


--

---
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_5424_31032402.1384455896935
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">If I specify a generic lambda as a key comparison for an a=
ssociative container will it have an is_transparent typedef?<div><br></div>=
<div><div>auto comp =3D []( const auto&amp; x, const auto&amp; y )</div><di=
v>{</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </s=
pan>return boost::iequals( x, y );</div><div>}</div><div><br></div><div>map=
&lt;string,int,decltype(comp)&gt; m(comp);</div><div><br></div><div>// If I=
 understand correctly this should not</div><div>// construct a temporary st=
ring if</div><div>// the generic lambda has is_transparent</div><div>m.find=
( string_view("hello world") );</div></div><div><br></div><div><br></div></=
div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_5424_31032402.1384455896935--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 14 Nov 2013 13:13:37 -0600
Raw View
--047d7bb70c58593ca204eb27e3d7
Content-Type: text/plain; charset=ISO-8859-1

[This belongs in std-discussion, not std-proposals]

On 14 November 2013 13:04, <mike.marcin@gmail.com> wrote:

> If I specify a generic lambda as a key comparison for an associative
> container will it have an is_transparent typedef?
>

No.

If you need something more than a lambda provides, write your own function
object.
--
 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/.

--047d7bb70c58593ca204eb27e3d7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">[This belongs in std-discussion, not std-proposals]<br><di=
v class=3D"gmail_extra"><br><div class=3D"gmail_quote">On 14 November 2013 =
13:04,  <span dir=3D"ltr">&lt;<a href=3D"mailto:mike.marcin@gmail.com" targ=
et=3D"_blank">mike.marcin@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">If I specify a generic lamb=
da as a key comparison for an associative container will it have an is_tran=
sparent typedef?</div>

</blockquote><div><br></div><div>No.<br><br></div><div>If you need somethin=
g more than a lambda provides, write your own function object.<br></div></d=
iv>-- <br>=A0Nevin &quot;:-)&quot; Liber=A0 &lt;mailto:<a href=3D"mailto:ne=
vin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>&gt;=A0 (=
847) 691-1404
</div></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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 />

--047d7bb70c58593ca204eb27e3d7--

.