[PATCH] D36049: [Resubmitted] Remove uses of deprecated std::unary_function, binary_function, and pointer_to_unary_function.

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 11:23:17 PDT 2017


David Blaikie via Phabricator <reviews at reviews.llvm.org> writes:
> dblaikie added inline comments.
>
> ================
> Comment at: include/llvm/ADT/STLExtras.h:61-62
> +struct identity {
> +  using argument_type = Ty;
> +  using result_type = Ty;
> +
> ----------------
> 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?

IIUC the intent of deprecating these wasn't to get rid of the typedefs,
but instead to discourage things from saying they operate specifically
on a unary_function. Ie, it's better if some algorithm depends (in a
SFINAE way) on the type defining an argument_type and result_type rather
than on the type being isa-unary_function.


More information about the llvm-commits mailing list