This patch tries to fix the issue that the implementation of reference_wrapper does not define nested types as described in C++11/14 standard section 20.8.3/20.9.3 [refwrap]. When T is a class with a nested type argument_type T1, the template instantiation reference_wrapper<T> shall define a nested type named argument_type as a synonym for T1. When T is a class with nested types named first_argument_type and second_argument_type of type T1 and T2, the template instantiation reference_wrapper<T> shall define two nested types named first_argument_type and second_argument_type as synonyms for T1 and T2, respectively. These types are deprecated in C++17 and removed in C++20.
The following test case demonstrates the issue.
#include <functional> int main(void) { struct S{ typedef int argument_type; typedef long first_argument_type; typedef float second_argument_type; }; typedef std::reference_wrapper<S>::argument_type A1; typedef std::reference_wrapper<S>::first_argument_type A2; typedef std::reference_wrapper<S>::second_argument_type A3; static_assert(std::is_same<S::argument_type, A1>::value, ""); static_assert(std::is_same<S::first_argument_type, A2>::value, ""); static_assert(std::is_same<S::second_argument_type, A3>::value, ""); return 0; }
You should use __void_t instead, it is available in all Standard modes.