From my understanding they are going to be removed and that's it.
I found the proposal here.
Related to first_argument_type
and second_argument_type
:
The adaptable function bindings were a strong candidate for removal in C++17, but were retained only because there was no adequate replacement for users of the unary/binary negators to migrate to. That feature, std::not_fn, was added to C++17 to allow the migration path,
Checking the std::not_fn for c++17 i found that:
Note that the adaptable function protocol no longer functions as well when it was originally designed, due to the addition of new language features and libraries, such as lambda expressions, "diamond" functors, and more. This is not due to a lack of effort, but simply that it is not possible to have a unique set of typedefs for some of these types, such as polymorphic lambda objects. However, we do pay a cost for retaining support elsewhere in the library, due to the awkward conditionally defined member typedefs in several components, such as std::function wrapping a function type with exactly one or two parameters, or similarly for std::reference_wrapper for function references of exactly one or two arguments.
This mean that they are going to just be removed.
One of the problems with first_argument_type
and second_argument_type
seems to be because of polymorphic lambda objects
.
Also as pointed in the comments, anything with multiple operator()
that can be passed to std::variant<...>::visit
have a problem with first_argument_type