[PATCH] D36049: [Resubmitted] Remove uses of deprecated std::unary_function, binary_function, and pointer_to_unary_function.
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 1 20:25:50 PDT 2017
On Tue, Aug 1, 2017 at 8:23 PM Saleem Abdulrasool via Phabricator <
reviews at reviews.llvm.org> wrote:
> compnerd added inline comments.
>
>
> ================
> Comment at: include/llvm/ADT/STLExtras.h:61-62
> +struct identity {
> + using argument_type = Ty;
> + using result_type = Ty;
> +
> ----------------
> dblaikie wrote:
> > Should these changes be adding all these typedefs? I assume the reason
> std::unary_function et. al. are deprecated is that callers should likely be
> using decltype & similar things to work here instead?
> Well, doing it this way makes it a NFC change.
Doing it the other way should still be NFC overall, but yeah, it's more
work - and ideally should migrate the users first, to the point where the
typedefs aren't needed, then drop the base classes without any replacement,
etc.
> Plus, doing something like decltype to get the argument types adds a bit
> of unnecessary complexity though.
>
Not sure about that - by using decltype in the users - those users will
generalize over any functor, not just those that provide these typedefs.
Typedefs that will become increasingly rare given the deprecation.
- Dave
>
>
> https://reviews.llvm.org/D36049
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170802/2f7d9237/attachment.html>
More information about the llvm-commits
mailing list