Topic: std::reverse_lookup for arrays, does it at


Author: =?UTF-8?Q?Micha=C5=82_Dominiak?= <griwes@griwes.info>
Date: Thu, 13 Oct 2016 15:00:37 +0000
Raw View
--001a114e7152ef17a9053ec05fa2
Content-Type: text/plain; charset=UTF-8

Sounds like a job for `std::find_if`.

On Thu, Oct 13, 2016 at 4:59 PM Nicol Bolas <jmckesson@gmail.com> wrote:

> What exactly do you mean by "reverse lookup"? What is this function
> supposed to return?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/67db4ec6-764c-4b31-a90d-22b0ec1ae0fd%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/67db4ec6-764c-4b31-a90d-22b0ec1ae0fd%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJdRy8m%3DmgBHt27VA48sknQYmencbtCxuHDCSKYM4D2U%3DGw%40mail.gmail.com.

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

<div dir=3D"ltr">Sounds like a job for `std::find_if`.</div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr">On Thu, Oct 13, 2016 at 4:59 PM Nicol Bol=
as &lt;<a href=3D"mailto:jmckesson@gmail.com">jmckesson@gmail.com</a>&gt; w=
rote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr" class=3D"gma=
il_msg">What exactly do you mean by &quot;reverse lookup&quot;? What is thi=
s function supposed to return?<br class=3D"gmail_msg"></div>

<p class=3D"gmail_msg"></p>

-- <br class=3D"gmail_msg">
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br class=3D"gmail_msg=
">
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" class=3D"gm=
ail_msg" target=3D"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br cla=
ss=3D"gmail_msg">
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" class=3D"gmail_msg" target=3D"_blank">std-proposals@isocpp.org</a>.<b=
r class=3D"gmail_msg">
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/67db4ec6-764c-4b31-a90d-22b0ec1ae0fd%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" class=3D"gmail_msg=
" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-prop=
osals/67db4ec6-764c-4b31-a90d-22b0ec1ae0fd%40isocpp.org</a>.<br class=3D"gm=
ail_msg">
</blockquote></div>

<p></p>

-- <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 <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAPCFJdRy8m%3DmgBHt27VA48sknQYmencbtC=
xuHDCSKYM4D2U%3DGw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJdRy8m%3=
DmgBHt27VA48sknQYmencbtCxuHDCSKYM4D2U%3DGw%40mail.gmail.com</a>.<br />

--001a114e7152ef17a9053ec05fa2--

.


Author: "Ivan G." <nekotekina@gmail.com>
Date: Fri, 14 Oct 2016 05:22:47 -0700 (PDT)
Raw View
------=_Part_818_164022212.1476447767811
Content-Type: multipart/alternative;
 boundary="----=_Part_819_1246463895.1476447767811"

------=_Part_819_1246463895.1476447767811
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Yes, it's effectively constexpr std::find_if. Can it itself become=20
constexpr in future? I also tried to imagine how it could work for C string=
=20
arrays, but maybe it needs totally different function.

=D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D0=B3, 13 =D0=BE=D0=BA=D1=82=D1=8F=D0=
=B1=D1=80=D1=8F 2016 =D0=B3., 18:00:50 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=
=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Micha=C5=82 Dominiak=20
=D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:
>
> Sounds like a job for `std::find_if`.
>
> On Thu, Oct 13, 2016 at 4:59 PM Nicol Bolas <jmck...@gmail.com=20
> <javascript:>> wrote:
>
>> What exactly do you mean by "reverse lookup"? What is this function=20
>> supposed to return?
>> --=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 <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit=20
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/67db4ec6-76=
4c-4b31-a90d-22b0ec1ae0fd%40isocpp.org=20
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/67db4ec6-7=
64c-4b31-a90d-22b0ec1ae0fd%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoo=
ter>
>> .
>>
>

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/d5b5e9e2-1110-41a9-92cc-1a9f54ac6b5a%40isocpp.or=
g.

------=_Part_819_1246463895.1476447767811
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Yes, it&#39;s effectively constexpr std::find_if. Can it i=
tself become constexpr in future? I also tried to imagine how it could work=
 for C string arrays, but maybe it needs totally different function.<br><br=
>=D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D0=B3, 13 =D0=BE=D0=BA=D1=82=D1=8F=D0=
=B1=D1=80=D1=8F 2016 =D0=B3., 18:00:50 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=
=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Micha=C5=82 Dominiak =D0=BD=D0=
=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<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">Sounds like a job for `std::find_if`.</div><br><div =
class=3D"gmail_quote"><div dir=3D"ltr">On Thu, Oct 13, 2016 at 4:59 PM Nico=
l Bolas &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=
=3D"onhqbrizAQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascri=
pt:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return =
true;">jmck...@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr">What exactly do you mean by &quot;reverse lookup&quot=
;? What is this function supposed to return?<br></div>



-- <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 <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
onhqbrizAQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"onhqbrizAQAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39=
;javascript:&#39;;return true;">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/67db4ec6-764c-4b31-a90d-22b0ec1ae0fd%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/67db4ec6-764c-4b31-a90d-22b0ec1ae0fd%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/67db4ec6-764c-4b31-a90d-22b0ec1ae0fd%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/isocpp.org/d/msgid/std-proposals/67db4ec6-764c-4b31-a90d-22b0ec1ae0fd%40=
isocpp.org</a>.<br>
</blockquote></div>
</blockquote></div>

<p></p>

-- <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 <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/d5b5e9e2-1110-41a9-92cc-1a9f54ac6b5a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/d5b5e9e2-1110-41a9-92cc-1a9f54ac6b5a=
%40isocpp.org</a>.<br />

------=_Part_819_1246463895.1476447767811--

------=_Part_818_164022212.1476447767811--

.


Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Fri, 14 Oct 2016 14:35:20 +0200
Raw View
2016-10-14 14:22 GMT+02:00 Ivan G. <nekotekina@gmail.com>:
> Yes, it's effectively constexpr std::find_if. Can it itself become constexpr
> in future? I also tried to imagine how it could work for C string arrays,
> but maybe it needs totally different function.

It is definitively possible to follow that path. There was a very
general proposal

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0202r1.html

and albeit it wasn't voted in during the Oulu meeting for C++17, LWG
was happy with it.

- Daniel

--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAGNvRgDs%2B1LVuw0qft2Qc%2B%3DNkWivVqm5Go3g4YVgiUAWy7i-YQ%40mail.gmail.com.

.


Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Fri, 14 Oct 2016 14:45:44 +0200
Raw View
2016-10-14 14:35 GMT+02:00 Daniel Kr=C3=BCgler <daniel.kruegler@gmail.com>:
> 2016-10-14 14:22 GMT+02:00 Ivan G. <nekotekina@gmail.com>:
>> Yes, it's effectively constexpr std::find_if. Can it itself become const=
expr
>> in future? I also tried to imagine how it could work for C string arrays=
,
>> but maybe it needs totally different function.
>
> It is definitively possible to follow that path. There was a very
> general proposal
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0202r1.html
>
> and albeit it wasn't voted in during the Oulu meeting for C++17, LWG
> was happy with it.

Let me insert here, that std::reverse_iterator got full constexpr
support by the very same author and was voted in during the
Jacksonville 2016 meeting:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0031r0.html

> - Daniel

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAGNvRgDZJchWncgUPuExqvB1OkGMbTbt6Q0Ud-tfWJUQPaW=
kWA%40mail.gmail.com.

.