<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 3, 2017 at 11:23 AM Justin Bogner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">David Blaikie via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> writes:<br>
> dblaikie added inline comments.<br>
><br>
> ================<br>
> Comment at: include/llvm/ADT/STLExtras.h:61-62<br>
> +struct identity {<br>
> +  using argument_type = Ty;<br>
> +  using result_type = Ty;<br>
> +<br>
> ----------------<br>
> Should these changes be adding all these typedefs? I assume the reason<br>
> std::unary_function et. al. are deprecated is that callers should<br>
> likely be using decltype & similar things to work here instead?<br>
<br>
IIUC the intent of deprecating these wasn't to get rid of the typedefs,<br>
but instead to discourage things from saying they operate specifically<br>
on a unary_function. Ie, it's better if some algorithm depends (in a<br>
SFINAE way) on the type defining an argument_type and result_type rather<br>
than on the type being isa-unary_function.<br></blockquote><div><br>Got a reference? That would seem somewhat surprising to me.<br><br>All the things in the standard library that used to derive from std::binary_function, etc, no longer do so and do not provide the typedefs. So any adapter we have that depends on the typedef is not going to work with the standard ones (std::plus<T> - to take a simple example) - nor any others likely to be written in the future. The typedefs as a means to interoperate with functors seems to have been removed/deprecated - so it doesn't look to me like removing the type but keeping the typedefs achieves so much of the point the standard was making of removing the types.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>